Re: remote filesystem locking ; problem in the VFS ????

Matthias Urlichs (smurf@nova.noris.de)
8 Jul 1997 21:36:20 +0200


Michel LESPINASSE <walken@foxfiber.com> writes:
>
> Am I right up to here ? and, what should be the prototype of this new
> interface function ? I'm thinking about something in the lines of
>
> int (*lock) (struct inode *i,int l);
>
> where l would be the locking mode (read lock, write lock, or unlock), and

You're forgetting starting offset and length.
(I don't know if ncpfs can lock byte ranges or just whole files... other
network file systems definitely can do that, though, so the interface
should afford it.)

> the result will be 0 or 1 for lock failure or lock success. Is this

The result should be -ERRNO for failure or something >= 0 for success.
Maybe some flags? 0 "everything went OK", 1 "I cannot lock ranges, so I had
to lock everything", 2 "I don't have shared (=read) locks so I had to do a
write lock", 3 = 1|2.

-- 
Matthias Urlichs         \  noris network GmbH  /  Xlink-POP Nürnberg 
Schleiermacherstraße 12   \   Linux+Internet   /   EMail: urlichs@noris.de
90491 Nürnberg (Germany)   \    Consulting+Programming+Networking+etc'ing
   PGP: 1024/4F578875   1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE
       Click <A HREF="http://info.noris.de/~smurf/finger">here</A>.    42