diff options
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8799b8708188..eca8aaa450f1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1579,8 +1579,8 @@ nfs4_upgrade_open(struct svc_rqst *rqstp, struct svc_fh *cur_fh, struct nfs4_sta | |||
1579 | } | 1579 | } |
1580 | /* remember the open */ | 1580 | /* remember the open */ |
1581 | filp->f_mode |= open->op_share_access; | 1581 | filp->f_mode |= open->op_share_access; |
1582 | set_bit(open->op_share_access, &stp->st_access_bmap); | 1582 | __set_bit(open->op_share_access, &stp->st_access_bmap); |
1583 | set_bit(open->op_share_deny, &stp->st_deny_bmap); | 1583 | __set_bit(open->op_share_deny, &stp->st_deny_bmap); |
1584 | 1584 | ||
1585 | return nfs_ok; | 1585 | return nfs_ok; |
1586 | } | 1586 | } |
@@ -1722,9 +1722,9 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf | |||
1722 | /* Stateid was not found, this is a new OPEN */ | 1722 | /* Stateid was not found, this is a new OPEN */ |
1723 | int flags = 0; | 1723 | int flags = 0; |
1724 | if (open->op_share_access & NFS4_SHARE_ACCESS_READ) | 1724 | if (open->op_share_access & NFS4_SHARE_ACCESS_READ) |
1725 | flags |= MAY_READ; | 1725 | flags |= NFSD_MAY_READ; |
1726 | if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) | 1726 | if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) |
1727 | flags |= MAY_WRITE; | 1727 | flags |= NFSD_MAY_WRITE; |
1728 | status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags); | 1728 | status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags); |
1729 | if (status) | 1729 | if (status) |
1730 | goto out; | 1730 | goto out; |
@@ -2610,7 +2610,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
2610 | return nfserr_inval; | 2610 | return nfserr_inval; |
2611 | 2611 | ||
2612 | if ((status = fh_verify(rqstp, &cstate->current_fh, | 2612 | if ((status = fh_verify(rqstp, &cstate->current_fh, |
2613 | S_IFREG, MAY_LOCK))) { | 2613 | S_IFREG, NFSD_MAY_LOCK))) { |
2614 | dprintk("NFSD: nfsd4_lock: permission denied!\n"); | 2614 | dprintk("NFSD: nfsd4_lock: permission denied!\n"); |
2615 | return status; | 2615 | return status; |
2616 | } | 2616 | } |
@@ -3249,12 +3249,14 @@ nfs4_state_shutdown(void) | |||
3249 | nfs4_unlock_state(); | 3249 | nfs4_unlock_state(); |
3250 | } | 3250 | } |
3251 | 3251 | ||
3252 | /* | ||
3253 | * user_recovery_dirname is protected by the nfsd_mutex since it's only | ||
3254 | * accessed when nfsd is starting. | ||
3255 | */ | ||
3252 | static void | 3256 | static void |
3253 | nfs4_set_recdir(char *recdir) | 3257 | nfs4_set_recdir(char *recdir) |
3254 | { | 3258 | { |
3255 | nfs4_lock_state(); | ||
3256 | strcpy(user_recovery_dirname, recdir); | 3259 | strcpy(user_recovery_dirname, recdir); |
3257 | nfs4_unlock_state(); | ||
3258 | } | 3260 | } |
3259 | 3261 | ||
3260 | /* | 3262 | /* |
@@ -3278,6 +3280,12 @@ nfs4_reset_recoverydir(char *recdir) | |||
3278 | return status; | 3280 | return status; |
3279 | } | 3281 | } |
3280 | 3282 | ||
3283 | char * | ||
3284 | nfs4_recoverydir(void) | ||
3285 | { | ||
3286 | return user_recovery_dirname; | ||
3287 | } | ||
3288 | |||
3281 | /* | 3289 | /* |
3282 | * Called when leasetime is changed. | 3290 | * Called when leasetime is changed. |
3283 | * | 3291 | * |
@@ -3286,11 +3294,12 @@ nfs4_reset_recoverydir(char *recdir) | |||
3286 | * we start to register any changes in lease time. If the administrator | 3294 | * we start to register any changes in lease time. If the administrator |
3287 | * really wants to change the lease time *now*, they can go ahead and bring | 3295 | * really wants to change the lease time *now*, they can go ahead and bring |
3288 | * nfsd down and then back up again after changing the lease time. | 3296 | * nfsd down and then back up again after changing the lease time. |
3297 | * | ||
3298 | * user_lease_time is protected by nfsd_mutex since it's only really accessed | ||
3299 | * when nfsd is starting | ||
3289 | */ | 3300 | */ |
3290 | void | 3301 | void |
3291 | nfs4_reset_lease(time_t leasetime) | 3302 | nfs4_reset_lease(time_t leasetime) |
3292 | { | 3303 | { |
3293 | lock_kernel(); | ||
3294 | user_lease_time = leasetime; | 3304 | user_lease_time = leasetime; |
3295 | unlock_kernel(); | ||
3296 | } | 3305 | } |