diff options
-rw-r--r-- | fs/locks.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c index f155ffd648bb..079abcd8a836 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -134,7 +134,7 @@ | |||
134 | 134 | ||
135 | #define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) | 135 | #define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) |
136 | #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) | 136 | #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) |
137 | #define IS_LEASE(fl) (fl->fl_flags & FL_LEASE) | 137 | #define IS_LEASE(fl) (fl->fl_flags & (FL_LEASE|FL_DELEG)) |
138 | 138 | ||
139 | static bool lease_breaking(struct file_lock *fl) | 139 | static bool lease_breaking(struct file_lock *fl) |
140 | { | 140 | { |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a601fd49f997..f36a30a9f2d1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3008,7 +3008,7 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_delegation *dp, int f | |||
3008 | return NULL; | 3008 | return NULL; |
3009 | locks_init_lock(fl); | 3009 | locks_init_lock(fl); |
3010 | fl->fl_lmops = &nfsd_lease_mng_ops; | 3010 | fl->fl_lmops = &nfsd_lease_mng_ops; |
3011 | fl->fl_flags = FL_LEASE; | 3011 | fl->fl_flags = FL_DELEG; |
3012 | fl->fl_type = flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK; | 3012 | fl->fl_type = flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK; |
3013 | fl->fl_end = OFFSET_MAX; | 3013 | fl->fl_end = OFFSET_MAX; |
3014 | fl->fl_owner = (fl_owner_t)(dp->dl_file); | 3014 | fl->fl_owner = (fl_owner_t)(dp->dl_file); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index ed7f94af1ab2..129e150f9e94 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -880,6 +880,7 @@ static inline int file_check_writeable(struct file *filp) | |||
880 | 880 | ||
881 | #define FL_POSIX 1 | 881 | #define FL_POSIX 1 |
882 | #define FL_FLOCK 2 | 882 | #define FL_FLOCK 2 |
883 | #define FL_DELEG 4 /* NFSv4 delegation */ | ||
883 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 884 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
884 | #define FL_EXISTS 16 /* when unlocking, test for existence */ | 885 | #define FL_EXISTS 16 /* when unlocking, test for existence */ |
885 | #define FL_LEASE 32 /* lease held on this file */ | 886 | #define FL_LEASE 32 /* lease held on this file */ |