On Mon, Apr 30, 2001 at 12:39:23PM -0600, Matthew Wilcox wrote:
> * All filesystems will fill in their ->lock method.
Why when a common stub should work for 90% of them? Please keep
global search-and-edit operation low when not absolutely possible.
> * Local filesystems should all use local_lock() for this method,
> unless they have a good reason to provide their own facilities.
So this should be default for ->lock
> A clustered filesystem might call out to the network and say `I want
> to put this lock on this file'. Either some other node in the cluster
> says `Denied', `Blocked' or `Granted' (ie handles the request), OR no
> other node accepts responsibility for the lock, in which case we lock
> it locally by calling local_lock().
It would be nice if it was possible to interface it to the distributed lock
manager IBM has recently GPLed...
> With the changes above, even this code can go away. The nfs client can
> keep a per-fs list of locks, and reestablish them at server restart.
> No need to interact with the local locking at all.
It's still linear lists I guess? Any evidence that a hash table or a ternary
search tree makes sense?
> * Mandatory Locks. These are byte-range mandatory locks. To use
> them, mount the filesystem with the `mand' option enabled, and set
> the file mode to g-x g+s. POSIX locks applied to this file will
> now be mandatory. Mandatory locks do not prevent accesses via
> mmap(). You should not use Mandatory locks in new code.
I would add a printk warning that fires 10 times, then you can get rid
of it.
> locks.c still runs almost entirely under the BKL. An earlier attempt
> to move it to a different locking scheme was thwarted when the code
> was integrated into 2.4.0-test9 while I was on holiday, and without me
> submitting it to Linus. Grumble. I plan to move it to _one_ spinlock
> to cover all lock-related structures, and I think that will be
> possible with the plan described above (since this code will no longer
> sleep).
I never understood why you can't do it completely inode local protected
by the inode lock; but then I don't claim that I understand fs/locks.c
It would be a small drawback for your new global locks because these inodes
could not be flushed (so you need a new resource management and perhaps
per user quotas for it anyways), but probably not worse than the current state.
> As soon as lockd no longer needs to keep its fingers inside locks.c, I
> want to remove the global list of locks. It's also used by /proc/locks
> -- which probably needs to go away anyway. So what's useful about
> /proc/locks? I'd like to be able to see which locks my process has,
Or just walk the inode hash ?
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]