Commit 8f8d338e authored by William A. Adamson's avatar William A. Adamson Committed by Linus Torvalds

[PATCH] nfs4 lease: add a lock manager copy lock callback

The following patches provide an interface to the lease subsystem in the
current VFS locking code.  NFSv4 delegations and Samba op-locks share most
architecture features.  The version 4 NFS server delegation implementation
should use leases to co-ordinate behavior between local, Samba, and NFS
access.


The main design points are

- Seperate the fcntl interface from the file_lock FL_LEASE processing in
  fcntl_setlease, creating __setlease() called by fcntl_setlease()

- Add new lock_manager callbacks to enable lease properties to be set,
  leases to be broken, and leases to be cleaned up: with default callbacks
  preserving the current fcntl_setlease properties.

- Add a new interface, setlease() which also calls __setlease(), and
  remove_lease() for kernel lease managers (e.g.  the v4 NFS server)


This patch:

Add a lock manager copy lock callback to locks_copy_lock() so that nfsd can
set lease properties.
Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 811308bb
......@@ -228,6 +228,8 @@ void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
new->fl_lmops = fl->fl_lmops;
if (fl->fl_ops && fl->fl_ops->fl_copy_lock)
fl->fl_ops->fl_copy_lock(new, fl);
if (fl->fl_lmops && fl->fl_lmops->fl_copy_lock)
fl->fl_lmops->fl_copy_lock(new, fl);
}
EXPORT_SYMBOL(locks_copy_lock);
......
......@@ -633,6 +633,7 @@ struct file_lock_operations {
struct lock_manager_operations {
int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
void (*fl_notify)(struct file_lock *); /* unblock callback */
void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
};
/* that will die - we need it for nfs_lock_info */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment