diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-23 15:24:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-23 15:24:56 -0500 |
commit | cc673757e24d018d64ff8038e28835db1e2902c4 (patch) | |
tree | 6eab3dab15725cda04dafabe9a8440697dca26cc /fs/nfs | |
parent | fa7d9a1d286e6bab49ffa59cbd3c8b394ce54339 (diff) | |
parent | e62e560fc8b65ef5debc9041a792d18a8f98b2ca (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull final vfs updates from Al Viro:
- The ->i_mutex wrappers (with small prereq in lustre)
- a fix for too early freeing of symlink bodies on shmem (they need to
be RCU-delayed) (-stable fodder)
- followup to dedupe stuff merged this cycle
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
vfs: abort dedupe loop if fatal signals are pending
make sure that freeing shmem fast symlinks is RCU-delayed
wrappers for ->i_mutex access
lustre: remove unused declaration
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 8 | ||||
-rw-r--r-- | fs/nfs/direct.c | 12 | ||||
-rw-r--r-- | fs/nfs/file.c | 4 | ||||
-rw-r--r-- | fs/nfs/inode.c | 8 | ||||
-rw-r--r-- | fs/nfs/nfs42proc.c | 8 | ||||
-rw-r--r-- | fs/nfs/nfs4file.c | 24 |
6 files changed, 32 insertions, 32 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index c82a21228a34..9cce67043f92 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -940,7 +940,7 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) | |||
940 | dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n", | 940 | dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n", |
941 | filp, offset, whence); | 941 | filp, offset, whence); |
942 | 942 | ||
943 | mutex_lock(&inode->i_mutex); | 943 | inode_lock(inode); |
944 | switch (whence) { | 944 | switch (whence) { |
945 | case 1: | 945 | case 1: |
946 | offset += filp->f_pos; | 946 | offset += filp->f_pos; |
@@ -957,7 +957,7 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) | |||
957 | dir_ctx->duped = 0; | 957 | dir_ctx->duped = 0; |
958 | } | 958 | } |
959 | out: | 959 | out: |
960 | mutex_unlock(&inode->i_mutex); | 960 | inode_unlock(inode); |
961 | return offset; | 961 | return offset; |
962 | } | 962 | } |
963 | 963 | ||
@@ -972,9 +972,9 @@ static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end, | |||
972 | 972 | ||
973 | dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync); | 973 | dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync); |
974 | 974 | ||
975 | mutex_lock(&inode->i_mutex); | 975 | inode_lock(inode); |
976 | nfs_inc_stats(inode, NFSIOS_VFSFSYNC); | 976 | nfs_inc_stats(inode, NFSIOS_VFSFSYNC); |
977 | mutex_unlock(&inode->i_mutex); | 977 | inode_unlock(inode); |
978 | return 0; | 978 | return 0; |
979 | } | 979 | } |
980 | 980 | ||
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 7ab7ec9f4eed..7a0cfd3266e5 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -580,7 +580,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, | |||
580 | if (!count) | 580 | if (!count) |
581 | goto out; | 581 | goto out; |
582 | 582 | ||
583 | mutex_lock(&inode->i_mutex); | 583 | inode_lock(inode); |
584 | result = nfs_sync_mapping(mapping); | 584 | result = nfs_sync_mapping(mapping); |
585 | if (result) | 585 | if (result) |
586 | goto out_unlock; | 586 | goto out_unlock; |
@@ -608,7 +608,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, | |||
608 | NFS_I(inode)->read_io += count; | 608 | NFS_I(inode)->read_io += count; |
609 | result = nfs_direct_read_schedule_iovec(dreq, iter, pos); | 609 | result = nfs_direct_read_schedule_iovec(dreq, iter, pos); |
610 | 610 | ||
611 | mutex_unlock(&inode->i_mutex); | 611 | inode_unlock(inode); |
612 | 612 | ||
613 | if (!result) { | 613 | if (!result) { |
614 | result = nfs_direct_wait(dreq); | 614 | result = nfs_direct_wait(dreq); |
@@ -622,7 +622,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, | |||
622 | out_release: | 622 | out_release: |
623 | nfs_direct_req_release(dreq); | 623 | nfs_direct_req_release(dreq); |
624 | out_unlock: | 624 | out_unlock: |
625 | mutex_unlock(&inode->i_mutex); | 625 | inode_unlock(inode); |
626 | out: | 626 | out: |
627 | return result; | 627 | return result; |
628 | } | 628 | } |
@@ -1005,7 +1005,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter) | |||
1005 | pos = iocb->ki_pos; | 1005 | pos = iocb->ki_pos; |
1006 | end = (pos + iov_iter_count(iter) - 1) >> PAGE_CACHE_SHIFT; | 1006 | end = (pos + iov_iter_count(iter) - 1) >> PAGE_CACHE_SHIFT; |
1007 | 1007 | ||
1008 | mutex_lock(&inode->i_mutex); | 1008 | inode_lock(inode); |
1009 | 1009 | ||
1010 | result = nfs_sync_mapping(mapping); | 1010 | result = nfs_sync_mapping(mapping); |
1011 | if (result) | 1011 | if (result) |
@@ -1045,7 +1045,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter) | |||
1045 | pos >> PAGE_CACHE_SHIFT, end); | 1045 | pos >> PAGE_CACHE_SHIFT, end); |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | mutex_unlock(&inode->i_mutex); | 1048 | inode_unlock(inode); |
1049 | 1049 | ||
1050 | if (!result) { | 1050 | if (!result) { |
1051 | result = nfs_direct_wait(dreq); | 1051 | result = nfs_direct_wait(dreq); |
@@ -1066,7 +1066,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter) | |||
1066 | out_release: | 1066 | out_release: |
1067 | nfs_direct_req_release(dreq); | 1067 | nfs_direct_req_release(dreq); |
1068 | out_unlock: | 1068 | out_unlock: |
1069 | mutex_unlock(&inode->i_mutex); | 1069 | inode_unlock(inode); |
1070 | return result; | 1070 | return result; |
1071 | } | 1071 | } |
1072 | 1072 | ||
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 4ef8f5addcad..748bb813b8ec 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -278,9 +278,9 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
278 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 278 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
279 | if (ret != 0) | 279 | if (ret != 0) |
280 | break; | 280 | break; |
281 | mutex_lock(&inode->i_mutex); | 281 | inode_lock(inode); |
282 | ret = nfs_file_fsync_commit(file, start, end, datasync); | 282 | ret = nfs_file_fsync_commit(file, start, end, datasync); |
283 | mutex_unlock(&inode->i_mutex); | 283 | inode_unlock(inode); |
284 | /* | 284 | /* |
285 | * If nfs_file_fsync_commit detected a server reboot, then | 285 | * If nfs_file_fsync_commit detected a server reboot, then |
286 | * resend all dirty pages that might have been covered by | 286 | * resend all dirty pages that might have been covered by |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 8e24d886d2c5..86faecf8f328 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -661,9 +661,9 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
661 | trace_nfs_getattr_enter(inode); | 661 | trace_nfs_getattr_enter(inode); |
662 | /* Flush out writes to the server in order to update c/mtime. */ | 662 | /* Flush out writes to the server in order to update c/mtime. */ |
663 | if (S_ISREG(inode->i_mode)) { | 663 | if (S_ISREG(inode->i_mode)) { |
664 | mutex_lock(&inode->i_mutex); | 664 | inode_lock(inode); |
665 | err = nfs_sync_inode(inode); | 665 | err = nfs_sync_inode(inode); |
666 | mutex_unlock(&inode->i_mutex); | 666 | inode_unlock(inode); |
667 | if (err) | 667 | if (err) |
668 | goto out; | 668 | goto out; |
669 | } | 669 | } |
@@ -1178,9 +1178,9 @@ static int __nfs_revalidate_mapping(struct inode *inode, | |||
1178 | spin_unlock(&inode->i_lock); | 1178 | spin_unlock(&inode->i_lock); |
1179 | trace_nfs_invalidate_mapping_enter(inode); | 1179 | trace_nfs_invalidate_mapping_enter(inode); |
1180 | if (may_lock) { | 1180 | if (may_lock) { |
1181 | mutex_lock(&inode->i_mutex); | 1181 | inode_lock(inode); |
1182 | ret = nfs_invalidate_mapping(inode, mapping); | 1182 | ret = nfs_invalidate_mapping(inode, mapping); |
1183 | mutex_unlock(&inode->i_mutex); | 1183 | inode_unlock(inode); |
1184 | } else | 1184 | } else |
1185 | ret = nfs_invalidate_mapping(inode, mapping); | 1185 | ret = nfs_invalidate_mapping(inode, mapping); |
1186 | trace_nfs_invalidate_mapping_exit(inode, ret); | 1186 | trace_nfs_invalidate_mapping_exit(inode, ret); |
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 6e8174930a48..bd25dc7077f7 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c | |||
@@ -101,13 +101,13 @@ int nfs42_proc_allocate(struct file *filep, loff_t offset, loff_t len) | |||
101 | if (!nfs_server_capable(inode, NFS_CAP_ALLOCATE)) | 101 | if (!nfs_server_capable(inode, NFS_CAP_ALLOCATE)) |
102 | return -EOPNOTSUPP; | 102 | return -EOPNOTSUPP; |
103 | 103 | ||
104 | mutex_lock(&inode->i_mutex); | 104 | inode_lock(inode); |
105 | 105 | ||
106 | err = nfs42_proc_fallocate(&msg, filep, offset, len); | 106 | err = nfs42_proc_fallocate(&msg, filep, offset, len); |
107 | if (err == -EOPNOTSUPP) | 107 | if (err == -EOPNOTSUPP) |
108 | NFS_SERVER(inode)->caps &= ~NFS_CAP_ALLOCATE; | 108 | NFS_SERVER(inode)->caps &= ~NFS_CAP_ALLOCATE; |
109 | 109 | ||
110 | mutex_unlock(&inode->i_mutex); | 110 | inode_unlock(inode); |
111 | return err; | 111 | return err; |
112 | } | 112 | } |
113 | 113 | ||
@@ -123,7 +123,7 @@ int nfs42_proc_deallocate(struct file *filep, loff_t offset, loff_t len) | |||
123 | return -EOPNOTSUPP; | 123 | return -EOPNOTSUPP; |
124 | 124 | ||
125 | nfs_wb_all(inode); | 125 | nfs_wb_all(inode); |
126 | mutex_lock(&inode->i_mutex); | 126 | inode_lock(inode); |
127 | 127 | ||
128 | err = nfs42_proc_fallocate(&msg, filep, offset, len); | 128 | err = nfs42_proc_fallocate(&msg, filep, offset, len); |
129 | if (err == 0) | 129 | if (err == 0) |
@@ -131,7 +131,7 @@ int nfs42_proc_deallocate(struct file *filep, loff_t offset, loff_t len) | |||
131 | if (err == -EOPNOTSUPP) | 131 | if (err == -EOPNOTSUPP) |
132 | NFS_SERVER(inode)->caps &= ~NFS_CAP_DEALLOCATE; | 132 | NFS_SERVER(inode)->caps &= ~NFS_CAP_DEALLOCATE; |
133 | 133 | ||
134 | mutex_unlock(&inode->i_mutex); | 134 | inode_unlock(inode); |
135 | return err; | 135 | return err; |
136 | } | 136 | } |
137 | 137 | ||
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 26f9a23e2b25..57ca1c8039c1 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c | |||
@@ -141,11 +141,11 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
141 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 141 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
142 | if (ret != 0) | 142 | if (ret != 0) |
143 | break; | 143 | break; |
144 | mutex_lock(&inode->i_mutex); | 144 | inode_lock(inode); |
145 | ret = nfs_file_fsync_commit(file, start, end, datasync); | 145 | ret = nfs_file_fsync_commit(file, start, end, datasync); |
146 | if (!ret) | 146 | if (!ret) |
147 | ret = pnfs_sync_inode(inode, !!datasync); | 147 | ret = pnfs_sync_inode(inode, !!datasync); |
148 | mutex_unlock(&inode->i_mutex); | 148 | inode_unlock(inode); |
149 | /* | 149 | /* |
150 | * If nfs_file_fsync_commit detected a server reboot, then | 150 | * If nfs_file_fsync_commit detected a server reboot, then |
151 | * resend all dirty pages that might have been covered by | 151 | * resend all dirty pages that might have been covered by |
@@ -219,13 +219,13 @@ static int nfs42_clone_file_range(struct file *src_file, loff_t src_off, | |||
219 | 219 | ||
220 | /* XXX: do we lock at all? what if server needs CB_RECALL_LAYOUT? */ | 220 | /* XXX: do we lock at all? what if server needs CB_RECALL_LAYOUT? */ |
221 | if (same_inode) { | 221 | if (same_inode) { |
222 | mutex_lock(&src_inode->i_mutex); | 222 | inode_lock(src_inode); |
223 | } else if (dst_inode < src_inode) { | 223 | } else if (dst_inode < src_inode) { |
224 | mutex_lock_nested(&dst_inode->i_mutex, I_MUTEX_PARENT); | 224 | inode_lock_nested(dst_inode, I_MUTEX_PARENT); |
225 | mutex_lock_nested(&src_inode->i_mutex, I_MUTEX_CHILD); | 225 | inode_lock_nested(src_inode, I_MUTEX_CHILD); |
226 | } else { | 226 | } else { |
227 | mutex_lock_nested(&src_inode->i_mutex, I_MUTEX_PARENT); | 227 | inode_lock_nested(src_inode, I_MUTEX_PARENT); |
228 | mutex_lock_nested(&dst_inode->i_mutex, I_MUTEX_CHILD); | 228 | inode_lock_nested(dst_inode, I_MUTEX_CHILD); |
229 | } | 229 | } |
230 | 230 | ||
231 | /* flush all pending writes on both src and dst so that server | 231 | /* flush all pending writes on both src and dst so that server |
@@ -246,13 +246,13 @@ static int nfs42_clone_file_range(struct file *src_file, loff_t src_off, | |||
246 | 246 | ||
247 | out_unlock: | 247 | out_unlock: |
248 | if (same_inode) { | 248 | if (same_inode) { |
249 | mutex_unlock(&src_inode->i_mutex); | 249 | inode_unlock(src_inode); |
250 | } else if (dst_inode < src_inode) { | 250 | } else if (dst_inode < src_inode) { |
251 | mutex_unlock(&src_inode->i_mutex); | 251 | inode_unlock(src_inode); |
252 | mutex_unlock(&dst_inode->i_mutex); | 252 | inode_unlock(dst_inode); |
253 | } else { | 253 | } else { |
254 | mutex_unlock(&dst_inode->i_mutex); | 254 | inode_unlock(dst_inode); |
255 | mutex_unlock(&src_inode->i_mutex); | 255 | inode_unlock(src_inode); |
256 | } | 256 | } |
257 | out: | 257 | out: |
258 | return ret; | 258 | return ret; |