aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2015-01-16 15:05:57 -0500
committerJeff Layton <jeff.layton@primarydata.com>2015-01-16 16:08:49 -0500
commit6109c85037e53443f29fd39c0de69f578a1cf285 (patch)
tree56823d1615acbba20c858eed9d16cf443cd55872 /fs/nfs/write.c
parenta7231a97467d5a0c36f82f581c76c12c034e4b80 (diff)
locks: add a dedicated spinlock to protect i_flctx lists
We can now add a dedicated spinlock without expanding struct inode. Change to using that to protect the various i_flctx lists. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Acked-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 784c13485b3f..4ae66f416eb9 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1206,7 +1206,7 @@ static int nfs_can_extend_write(struct file *file, struct page *page, struct ino
1206 1206
1207 /* Check to see if there are whole file write locks */ 1207 /* Check to see if there are whole file write locks */
1208 ret = 0; 1208 ret = 0;
1209 spin_lock(&inode->i_lock); 1209 spin_lock(&flctx->flc_lock);
1210 if (!list_empty(&flctx->flc_posix)) { 1210 if (!list_empty(&flctx->flc_posix)) {
1211 fl = list_first_entry(&flctx->flc_posix, struct file_lock, 1211 fl = list_first_entry(&flctx->flc_posix, struct file_lock,
1212 fl_list); 1212 fl_list);
@@ -1218,7 +1218,7 @@ static int nfs_can_extend_write(struct file *file, struct page *page, struct ino
1218 if (fl->fl_type == F_WRLCK) 1218 if (fl->fl_type == F_WRLCK)
1219 ret = 1; 1219 ret = 1;
1220 } 1220 }
1221 spin_unlock(&inode->i_lock); 1221 spin_unlock(&flctx->flc_lock);
1222 return ret; 1222 return ret;
1223} 1223}
1224 1224