locks/nfsd: allocate file lock outside of spinlock

As suggested by Christoph Hellwig, this moves allocation
of new file locks out of generic_setlease into the
callers, nfs4_open_delegation and fcntl_setlease in order
to allow GFP_KERNEL allocations when lock_flocks has
become a spinlock.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Arnd Bergmann
2010-10-27 15:46:08 +02:00
parent a282a1fa6b
commit c5b1f0d92c
3 changed files with 28 additions and 35 deletions

View File

@ -1113,6 +1113,7 @@ extern int fcntl_getlease(struct file *filp);
/* fs/locks.c */
extern void locks_init_lock(struct file_lock *);
extern struct file_lock * locks_alloc_lock(void);
extern void locks_copy_lock(struct file_lock *, struct file_lock *);
extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
extern void locks_remove_posix(struct file *, fl_owner_t);