diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-08-30 18:30:38 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-08-30 18:30:38 -0400 |
commit | 0a7d5f8ce960e74fa22986bda4af488539796e49 (patch) | |
tree | e29ad17808a5c3410518e22dae8dfe94801b59f3 /fs/nfsd | |
parent | 0165508c80a2b5d5268d9c5dfa9b30c534a33693 (diff) | |
parent | dc709bd190c130b299ac19d596594256265c042a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 8 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 20 | ||||
-rw-r--r-- | fs/nfsd/stats.c | 10 |
3 files changed, 31 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index b0e095ea0c03..ee4eff27aedc 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -721,6 +721,12 @@ nfsd4_proc_null(struct svc_rqst *rqstp, void *argp, void *resp) | |||
721 | return nfs_ok; | 721 | return nfs_ok; |
722 | } | 722 | } |
723 | 723 | ||
724 | static inline void nfsd4_increment_op_stats(u32 opnum) | ||
725 | { | ||
726 | if (opnum >= FIRST_NFS4_OP && opnum <= LAST_NFS4_OP) | ||
727 | nfsdstats.nfs4_opcount[opnum]++; | ||
728 | } | ||
729 | |||
724 | 730 | ||
725 | /* | 731 | /* |
726 | * COMPOUND call. | 732 | * COMPOUND call. |
@@ -930,6 +936,8 @@ encode_op: | |||
930 | /* XXX Ugh, we need to get rid of this kind of special case: */ | 936 | /* XXX Ugh, we need to get rid of this kind of special case: */ |
931 | if (op->opnum == OP_READ && op->u.read.rd_filp) | 937 | if (op->opnum == OP_READ && op->u.read.rd_filp) |
932 | fput(op->u.read.rd_filp); | 938 | fput(op->u.read.rd_filp); |
939 | |||
940 | nfsd4_increment_op_stats(op->opnum); | ||
933 | } | 941 | } |
934 | 942 | ||
935 | out: | 943 | out: |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index ecc439d2565f..501d83884530 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -187,6 +187,11 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
187 | goto out; | 187 | goto out; |
188 | } | 188 | } |
189 | 189 | ||
190 | /* Set user creds for this exportpoint */ | ||
191 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
192 | if (error) | ||
193 | goto out; | ||
194 | |||
190 | /* | 195 | /* |
191 | * Look up the dentry using the NFS file handle. | 196 | * Look up the dentry using the NFS file handle. |
192 | */ | 197 | */ |
@@ -241,16 +246,17 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
241 | dprintk("nfsd: fh_verify - just checking\n"); | 246 | dprintk("nfsd: fh_verify - just checking\n"); |
242 | dentry = fhp->fh_dentry; | 247 | dentry = fhp->fh_dentry; |
243 | exp = fhp->fh_export; | 248 | exp = fhp->fh_export; |
249 | /* Set user creds for this exportpoint; necessary even | ||
250 | * in the "just checking" case because this may be a | ||
251 | * filehandle that was created by fh_compose, and that | ||
252 | * is about to be used in another nfsv4 compound | ||
253 | * operation */ | ||
254 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
255 | if (error) | ||
256 | goto out; | ||
244 | } | 257 | } |
245 | cache_get(&exp->h); | 258 | cache_get(&exp->h); |
246 | 259 | ||
247 | /* Set user creds for this exportpoint; necessary even in the "just | ||
248 | * checking" case because this may be a filehandle that was created by | ||
249 | * fh_compose, and that is about to be used in another nfsv4 compound | ||
250 | * operation */ | ||
251 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
252 | if (error) | ||
253 | goto out; | ||
254 | 260 | ||
255 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); | 261 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); |
256 | if (error) | 262 | if (error) |
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c index 57265d563804..71944cddf680 100644 --- a/fs/nfsd/stats.c +++ b/fs/nfsd/stats.c | |||
@@ -72,6 +72,16 @@ static int nfsd_proc_show(struct seq_file *seq, void *v) | |||
72 | /* show my rpc info */ | 72 | /* show my rpc info */ |
73 | svc_seq_show(seq, &nfsd_svcstats); | 73 | svc_seq_show(seq, &nfsd_svcstats); |
74 | 74 | ||
75 | #ifdef CONFIG_NFSD_V4 | ||
76 | /* Show count for individual nfsv4 operations */ | ||
77 | /* Writing operation numbers 0 1 2 also for maintaining uniformity */ | ||
78 | seq_printf(seq,"proc4ops %u", LAST_NFS4_OP + 1); | ||
79 | for (i = 0; i <= LAST_NFS4_OP; i++) | ||
80 | seq_printf(seq, " %u", nfsdstats.nfs4_opcount[i]); | ||
81 | |||
82 | seq_putc(seq, '\n'); | ||
83 | #endif | ||
84 | |||
75 | return 0; | 85 | return 0; |
76 | } | 86 | } |
77 | 87 | ||