summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2005-03-09 16:46:32 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-09 16:46:32 -0800
commit99a9f594f96ae4478d5a36d1fc249508068543d7 (patch)
tree2712a8bc367286bb997554038ca915d7570dd952 /include/linux
parent7d4ef76cacef291d7ee95f8758880cfb57f2d3b7 (diff)
[PATCH] nfsd4: use existing open instead of reopening on read and write
Use the struct file * obtained in nfsd4_open for nfsd_read and nfsd_write when available. To do this we add a struct file * argument to nfsd_read and nfsd_write. If a struct file is passed in, nfsd_read and nfsd_write will use it, doing just an access check instead of an open and close. If the new argument is NULL, they will fall back on the old behaviour. Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfsd/nfsd.h6
-rw-r--r--include/linux/nfsd/state.h2
-rw-r--r--include/linux/nfsd/xdr4.h1
3 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 8e189dbba426..ae14a0124ea1 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -96,9 +96,9 @@ int nfsd_commit(struct svc_rqst *, struct svc_fh *,
int nfsd_open(struct svc_rqst *, struct svc_fh *, int,
int, struct file **);
void nfsd_close(struct file *);
-int nfsd_read(struct svc_rqst *, struct svc_fh *,
- loff_t, struct kvec *,int, unsigned long *);
-int nfsd_write(struct svc_rqst *, struct svc_fh *,
+int nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
+ loff_t, struct kvec *, int, unsigned long *);
+int nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
loff_t, struct kvec *,int, unsigned long, int *);
int nfsd_readlink(struct svc_rqst *, struct svc_fh *,
char *, int *);
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 91fd6a8f7c8a..a7431a1bf68e 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -279,7 +279,7 @@ struct nfs4_stateid {
extern time_t nfs4_laundromat(void);
extern int nfsd4_renew(clientid_t *clid);
extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh,
- stateid_t *stateid, int flags);
+ stateid_t *stateid, int flags, struct file **filp);
extern int nfs4_share_conflict(struct svc_fh *current_fh,
unsigned int deny_type);
extern void nfs4_lock_state(void);
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index a63238354be7..a1f5ad0be1bf 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -241,6 +241,7 @@ struct nfsd4_read {
u32 rd_length; /* request */
struct kvec rd_iov[RPCSVC_MAXPAGES];
int rd_vlen;
+ struct file *rd_filp;
struct svc_rqst *rd_rqstp; /* response */
struct svc_fh * rd_fhp; /* response */