aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-22 15:40:57 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-01-22 18:04:28 -0500
commit5955102c9984fa081b2d570cfac75c97eecf8f3b (patch)
treea4744386eac4b916e847eb4eedfada158f6527b4 /fs/nfsd
parent57b8f112cfe6622ddddb8c2641206bb5fa8a112d (diff)
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested}, inode_foo(inode) being mutex_foo(&inode->i_mutex). Please, use those for access to ->i_mutex; over the coming cycle ->i_mutex will become rwsem, with ->lookup() done with it held only shared. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c4
-rw-r--r--fs/nfsd/nfs4recover.c12
-rw-r--r--fs/nfsd/nfsfh.h4
-rw-r--r--fs/nfsd/vfs.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 819ad812c71b..4cba7865f496 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -55,10 +55,10 @@ nfsd4_security_inode_setsecctx(struct svc_fh *resfh, struct xdr_netobj *label, u
55 struct inode *inode = d_inode(resfh->fh_dentry); 55 struct inode *inode = d_inode(resfh->fh_dentry);
56 int status; 56 int status;
57 57
58 mutex_lock(&inode->i_mutex); 58 inode_lock(inode);
59 status = security_inode_setsecctx(resfh->fh_dentry, 59 status = security_inode_setsecctx(resfh->fh_dentry,
60 label->data, label->len); 60 label->data, label->len);
61 mutex_unlock(&inode->i_mutex); 61 inode_unlock(inode);
62 62
63 if (status) 63 if (status)
64 /* 64 /*
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 79f0307a5ec8..dc8ebecf5618 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -192,7 +192,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
192 192
193 dir = nn->rec_file->f_path.dentry; 193 dir = nn->rec_file->f_path.dentry;
194 /* lock the parent */ 194 /* lock the parent */
195 mutex_lock(&d_inode(dir)->i_mutex); 195 inode_lock(d_inode(dir));
196 196
197 dentry = lookup_one_len(dname, dir, HEXDIR_LEN-1); 197 dentry = lookup_one_len(dname, dir, HEXDIR_LEN-1);
198 if (IS_ERR(dentry)) { 198 if (IS_ERR(dentry)) {
@@ -213,7 +213,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
213out_put: 213out_put:
214 dput(dentry); 214 dput(dentry);
215out_unlock: 215out_unlock:
216 mutex_unlock(&d_inode(dir)->i_mutex); 216 inode_unlock(d_inode(dir));
217 if (status == 0) { 217 if (status == 0) {
218 if (nn->in_grace) { 218 if (nn->in_grace) {
219 crp = nfs4_client_to_reclaim(dname, nn); 219 crp = nfs4_client_to_reclaim(dname, nn);
@@ -286,7 +286,7 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn)
286 } 286 }
287 287
288 status = iterate_dir(nn->rec_file, &ctx.ctx); 288 status = iterate_dir(nn->rec_file, &ctx.ctx);
289 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); 289 inode_lock_nested(d_inode(dir), I_MUTEX_PARENT);
290 290
291 list_for_each_entry_safe(entry, tmp, &ctx.names, list) { 291 list_for_each_entry_safe(entry, tmp, &ctx.names, list) {
292 if (!status) { 292 if (!status) {
@@ -302,7 +302,7 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn)
302 list_del(&entry->list); 302 list_del(&entry->list);
303 kfree(entry); 303 kfree(entry);
304 } 304 }
305 mutex_unlock(&d_inode(dir)->i_mutex); 305 inode_unlock(d_inode(dir));
306 nfs4_reset_creds(original_cred); 306 nfs4_reset_creds(original_cred);
307 307
308 list_for_each_entry_safe(entry, tmp, &ctx.names, list) { 308 list_for_each_entry_safe(entry, tmp, &ctx.names, list) {
@@ -322,7 +322,7 @@ nfsd4_unlink_clid_dir(char *name, int namlen, struct nfsd_net *nn)
322 dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); 322 dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name);
323 323
324 dir = nn->rec_file->f_path.dentry; 324 dir = nn->rec_file->f_path.dentry;
325 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); 325 inode_lock_nested(d_inode(dir), I_MUTEX_PARENT);
326 dentry = lookup_one_len(name, dir, namlen); 326 dentry = lookup_one_len(name, dir, namlen);
327 if (IS_ERR(dentry)) { 327 if (IS_ERR(dentry)) {
328 status = PTR_ERR(dentry); 328 status = PTR_ERR(dentry);
@@ -335,7 +335,7 @@ nfsd4_unlink_clid_dir(char *name, int namlen, struct nfsd_net *nn)
335out: 335out:
336 dput(dentry); 336 dput(dentry);
337out_unlock: 337out_unlock:
338 mutex_unlock(&d_inode(dir)->i_mutex); 338 inode_unlock(d_inode(dir));
339 return status; 339 return status;
340} 340}
341 341
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h
index 0770bcb543c8..f84fe6bf9aee 100644
--- a/fs/nfsd/nfsfh.h
+++ b/fs/nfsd/nfsfh.h
@@ -288,7 +288,7 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
288 } 288 }
289 289
290 inode = d_inode(dentry); 290 inode = d_inode(dentry);
291 mutex_lock_nested(&inode->i_mutex, subclass); 291 inode_lock_nested(inode, subclass);
292 fill_pre_wcc(fhp); 292 fill_pre_wcc(fhp);
293 fhp->fh_locked = true; 293 fhp->fh_locked = true;
294} 294}
@@ -307,7 +307,7 @@ fh_unlock(struct svc_fh *fhp)
307{ 307{
308 if (fhp->fh_locked) { 308 if (fhp->fh_locked) {
309 fill_post_wcc(fhp); 309 fill_post_wcc(fhp);
310 mutex_unlock(&d_inode(fhp->fh_dentry)->i_mutex); 310 inode_unlock(d_inode(fhp->fh_dentry));
311 fhp->fh_locked = false; 311 fhp->fh_locked = false;
312 } 312 }
313} 313}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6739077f17fe..5d2a57e4c03a 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -493,9 +493,9 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp,
493 493
494 dentry = fhp->fh_dentry; 494 dentry = fhp->fh_dentry;
495 495
496 mutex_lock(&d_inode(dentry)->i_mutex); 496 inode_lock(d_inode(dentry));
497 host_error = security_inode_setsecctx(dentry, label->data, label->len); 497 host_error = security_inode_setsecctx(dentry, label->data, label->len);
498 mutex_unlock(&d_inode(dentry)->i_mutex); 498 inode_unlock(d_inode(dentry));
499 return nfserrno(host_error); 499 return nfserrno(host_error);
500} 500}
501#else 501#else