aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-01-23 13:52:01 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-01-27 13:59:15 -0500
commite873088f2939dcd60721183ce6802515afc43ceb (patch)
tree70ccd09d0a3866613651658aa6ac8621170f3063 /fs/nfsd/nfs4state.c
parentc692554bf4fe50a0187744663acc935d10e210a2 (diff)
nfsd4: minor nfs4_setlease cleanup
As far as I can tell, this list is used only under the state lock, so we may as well do this in the simpler order. Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 5795d5f58f41..ed3085b2bf16 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3043,18 +3043,18 @@ static int nfs4_setlease(struct nfs4_delegation *dp)
3043 if (!fl) 3043 if (!fl)
3044 return -ENOMEM; 3044 return -ENOMEM;
3045 fl->fl_file = find_readable_file(fp); 3045 fl->fl_file = find_readable_file(fp);
3046 list_add(&dp->dl_perclnt, &dp->dl_stid.sc_client->cl_delegations);
3047 status = vfs_setlease(fl->fl_file, fl->fl_type, &fl); 3046 status = vfs_setlease(fl->fl_file, fl->fl_type, &fl);
3048 if (status) { 3047 if (status)
3049 list_del_init(&dp->dl_perclnt); 3048 goto out_free;
3050 locks_free_lock(fl); 3049 list_add(&dp->dl_perclnt, &dp->dl_stid.sc_client->cl_delegations);
3051 return status;
3052 }
3053 fp->fi_lease = fl; 3050 fp->fi_lease = fl;
3054 fp->fi_deleg_file = get_file(fl->fl_file); 3051 fp->fi_deleg_file = get_file(fl->fl_file);
3055 atomic_set(&fp->fi_delegees, 1); 3052 atomic_set(&fp->fi_delegees, 1);
3056 list_add(&dp->dl_perfile, &fp->fi_delegations); 3053 list_add(&dp->dl_perfile, &fp->fi_delegations);
3057 return 0; 3054 return 0;
3055out_free:
3056 locks_free_lock(fl);
3057 return status;
3058} 3058}
3059 3059
3060static int nfs4_set_delegation(struct nfs4_delegation *dp, struct nfs4_file *fp) 3060static int nfs4_set_delegation(struct nfs4_delegation *dp, struct nfs4_file *fp)