locks: create a new notifier chain for lease attempts
With the new file caching infrastructure in nfsd, we can end up holding files open for an indefinite period of time, even when they are still idle. This may prevent the kernel from handing out leases on the file, which is something we don't want to block. Fix this by running a SRCU notifier call chain whenever on any lease attempt. nfsd can then purge the cache for that inode before returning. Since SRCU is only conditionally compiled in, we must only define the new chain if it's enabled, and users of the chain must ensure that SRCU is enabled. Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:

committed by
J. Bruce Fields

parent
f69d6d8eef
commit
18f6622ebb
@@ -1155,6 +1155,11 @@ extern void lease_get_mtime(struct inode *, struct timespec64 *time);
|
||||
extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
|
||||
extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
|
||||
extern int lease_modify(struct file_lock *, int, struct list_head *);
|
||||
|
||||
struct notifier_block;
|
||||
extern int lease_register_notifier(struct notifier_block *);
|
||||
extern void lease_unregister_notifier(struct notifier_block *);
|
||||
|
||||
struct files_struct;
|
||||
extern void show_fd_locks(struct seq_file *f,
|
||||
struct file *filp, struct files_struct *files);
|
||||
|
Reference in New Issue
Block a user