diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-20 02:29:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:43 -0400 |
commit | b8dd7b9ab194d9ab322881f49fde42954757efae (patch) | |
tree | 2709bca272730c061faee95bbbcac12343968de3 /fs/nfsd/nfs4state.c | |
parent | c4d987ba841dff4b2fc768e52d1d95af83f9f157 (diff) |
[PATCH] nfsd: NFSv4 errno endianness annotations
don't use the same variable to store NFS and host error values
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e5ca6d7028df..ae1d47715b90 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2646,6 +2646,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock | |||
2646 | struct file_lock conflock; | 2646 | struct file_lock conflock; |
2647 | __be32 status = 0; | 2647 | __be32 status = 0; |
2648 | unsigned int strhashval; | 2648 | unsigned int strhashval; |
2649 | int err; | ||
2649 | 2650 | ||
2650 | dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n", | 2651 | dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n", |
2651 | (long long) lock->lk_offset, | 2652 | (long long) lock->lk_offset, |
@@ -2758,13 +2759,14 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock | |||
2758 | * locks_copy_lock: */ | 2759 | * locks_copy_lock: */ |
2759 | conflock.fl_ops = NULL; | 2760 | conflock.fl_ops = NULL; |
2760 | conflock.fl_lmops = NULL; | 2761 | conflock.fl_lmops = NULL; |
2761 | status = posix_lock_file_conf(filp, &file_lock, &conflock); | 2762 | err = posix_lock_file_conf(filp, &file_lock, &conflock); |
2762 | dprintk("NFSD: nfsd4_lock: posix_lock_file_conf status %d\n",status); | 2763 | dprintk("NFSD: nfsd4_lock: posix_lock_file_conf status %d\n",status); |
2763 | switch (-status) { | 2764 | switch (-err) { |
2764 | case 0: /* success! */ | 2765 | case 0: /* success! */ |
2765 | update_stateid(&lock_stp->st_stateid); | 2766 | update_stateid(&lock_stp->st_stateid); |
2766 | memcpy(&lock->lk_resp_stateid, &lock_stp->st_stateid, | 2767 | memcpy(&lock->lk_resp_stateid, &lock_stp->st_stateid, |
2767 | sizeof(stateid_t)); | 2768 | sizeof(stateid_t)); |
2769 | status = 0; | ||
2768 | break; | 2770 | break; |
2769 | case (EAGAIN): /* conflock holds conflicting lock */ | 2771 | case (EAGAIN): /* conflock holds conflicting lock */ |
2770 | status = nfserr_denied; | 2772 | status = nfserr_denied; |
@@ -2775,7 +2777,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock | |||
2775 | status = nfserr_deadlock; | 2777 | status = nfserr_deadlock; |
2776 | break; | 2778 | break; |
2777 | default: | 2779 | default: |
2778 | dprintk("NFSD: nfsd4_lock: posix_lock_file_conf() failed! status %d\n",status); | 2780 | dprintk("NFSD: nfsd4_lock: posix_lock_file_conf() failed! status %d\n",err); |
2779 | status = nfserr_resource; | 2781 | status = nfserr_resource; |
2780 | break; | 2782 | break; |
2781 | } | 2783 | } |
@@ -2880,6 +2882,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock | |||
2880 | struct file *filp = NULL; | 2882 | struct file *filp = NULL; |
2881 | struct file_lock file_lock; | 2883 | struct file_lock file_lock; |
2882 | __be32 status; | 2884 | __be32 status; |
2885 | int err; | ||
2883 | 2886 | ||
2884 | dprintk("NFSD: nfsd4_locku: start=%Ld length=%Ld\n", | 2887 | dprintk("NFSD: nfsd4_locku: start=%Ld length=%Ld\n", |
2885 | (long long) locku->lu_offset, | 2888 | (long long) locku->lu_offset, |
@@ -2917,8 +2920,8 @@ nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock | |||
2917 | /* | 2920 | /* |
2918 | * Try to unlock the file in the VFS. | 2921 | * Try to unlock the file in the VFS. |
2919 | */ | 2922 | */ |
2920 | status = posix_lock_file(filp, &file_lock); | 2923 | err = posix_lock_file(filp, &file_lock); |
2921 | if (status) { | 2924 | if (err) { |
2922 | dprintk("NFSD: nfs4_locku: posix_lock_file failed!\n"); | 2925 | dprintk("NFSD: nfs4_locku: posix_lock_file failed!\n"); |
2923 | goto out_nfserr; | 2926 | goto out_nfserr; |
2924 | } | 2927 | } |
@@ -2937,7 +2940,7 @@ out: | |||
2937 | return status; | 2940 | return status; |
2938 | 2941 | ||
2939 | out_nfserr: | 2942 | out_nfserr: |
2940 | status = nfserrno(status); | 2943 | status = nfserrno(err); |
2941 | goto out; | 2944 | goto out; |
2942 | } | 2945 | } |
2943 | 2946 | ||