NFSD: pass an integer for stable type to nfsd_vfs_write
After fae5096ad2
"nfsd: assume writeable exportabled filesystems have
f_sync" we no longer modify this argument.
This is just cleanup, no change in functionality.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
e35659f1b0
commit
54bbb7d206
|
@ -197,7 +197,7 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
|
||||||
argp->offset,
|
argp->offset,
|
||||||
rqstp->rq_vec, argp->vlen,
|
rqstp->rq_vec, argp->vlen,
|
||||||
&cnt,
|
&cnt,
|
||||||
&resp->committed);
|
resp->committed);
|
||||||
resp->count = cnt;
|
resp->count = cnt;
|
||||||
RETURN_STATUS(nfserr);
|
RETURN_STATUS(nfserr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -983,7 +983,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
||||||
|
|
||||||
status = nfsd_vfs_write(rqstp, &cstate->current_fh, filp,
|
status = nfsd_vfs_write(rqstp, &cstate->current_fh, filp,
|
||||||
write->wr_offset, rqstp->rq_vec, nvecs, &cnt,
|
write->wr_offset, rqstp->rq_vec, nvecs, &cnt,
|
||||||
&write->wr_how_written);
|
write->wr_how_written);
|
||||||
fput(filp);
|
fput(filp);
|
||||||
|
|
||||||
write->wr_bytes_written = cnt;
|
write->wr_bytes_written = cnt;
|
||||||
|
|
|
@ -1250,7 +1250,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
|
||||||
READ_BUF(16);
|
READ_BUF(16);
|
||||||
p = xdr_decode_hyper(p, &write->wr_offset);
|
p = xdr_decode_hyper(p, &write->wr_offset);
|
||||||
write->wr_stable_how = be32_to_cpup(p++);
|
write->wr_stable_how = be32_to_cpup(p++);
|
||||||
if (write->wr_stable_how > 2)
|
if (write->wr_stable_how > NFS_FILE_SYNC)
|
||||||
goto xdr_error;
|
goto xdr_error;
|
||||||
write->wr_buflen = be32_to_cpup(p++);
|
write->wr_buflen = be32_to_cpup(p++);
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,6 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
|
||||||
struct nfsd_attrstat *resp)
|
struct nfsd_attrstat *resp)
|
||||||
{
|
{
|
||||||
__be32 nfserr;
|
__be32 nfserr;
|
||||||
int stable = 1;
|
|
||||||
unsigned long cnt = argp->len;
|
unsigned long cnt = argp->len;
|
||||||
|
|
||||||
dprintk("nfsd: WRITE %s %d bytes at %d\n",
|
dprintk("nfsd: WRITE %s %d bytes at %d\n",
|
||||||
|
@ -215,7 +214,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
|
||||||
argp->offset,
|
argp->offset,
|
||||||
rqstp->rq_vec, argp->vlen,
|
rqstp->rq_vec, argp->vlen,
|
||||||
&cnt,
|
&cnt,
|
||||||
&stable);
|
NFS_DATA_SYNC);
|
||||||
return nfsd_return_attrs(nfserr, resp);
|
return nfsd_return_attrs(nfserr, resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -917,14 +917,13 @@ static int wait_for_concurrent_writes(struct file *file)
|
||||||
__be32
|
__be32
|
||||||
nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||||
loff_t offset, struct kvec *vec, int vlen,
|
loff_t offset, struct kvec *vec, int vlen,
|
||||||
unsigned long *cnt, int *stablep)
|
unsigned long *cnt, int stable)
|
||||||
{
|
{
|
||||||
struct svc_export *exp;
|
struct svc_export *exp;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
__be32 err = 0;
|
__be32 err = 0;
|
||||||
int host_err;
|
int host_err;
|
||||||
int stable = *stablep;
|
|
||||||
int use_wgather;
|
int use_wgather;
|
||||||
loff_t pos = offset;
|
loff_t pos = offset;
|
||||||
unsigned int pflags = current->flags;
|
unsigned int pflags = current->flags;
|
||||||
|
@ -945,7 +944,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||||
use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp);
|
use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp);
|
||||||
|
|
||||||
if (!EX_ISSYNC(exp))
|
if (!EX_ISSYNC(exp))
|
||||||
stable = 0;
|
stable = NFS_UNSTABLE;
|
||||||
|
|
||||||
if (stable && !use_wgather)
|
if (stable && !use_wgather)
|
||||||
flags |= RWF_SYNC;
|
flags |= RWF_SYNC;
|
||||||
|
@ -1014,7 +1013,7 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
|
||||||
__be32
|
__be32
|
||||||
nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||||
loff_t offset, struct kvec *vec, int vlen, unsigned long *cnt,
|
loff_t offset, struct kvec *vec, int vlen, unsigned long *cnt,
|
||||||
int *stablep)
|
int stable)
|
||||||
{
|
{
|
||||||
__be32 err = 0;
|
__be32 err = 0;
|
||||||
|
|
||||||
|
@ -1027,7 +1026,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||||
goto out;
|
goto out;
|
||||||
trace_write_opened(rqstp, fhp, offset, vlen);
|
trace_write_opened(rqstp, fhp, offset, vlen);
|
||||||
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt,
|
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt,
|
||||||
stablep);
|
stable);
|
||||||
trace_write_io_done(rqstp, fhp, offset, vlen);
|
trace_write_io_done(rqstp, fhp, offset, vlen);
|
||||||
} else {
|
} else {
|
||||||
err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file);
|
err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file);
|
||||||
|
@ -1037,7 +1036,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||||
trace_write_opened(rqstp, fhp, offset, vlen);
|
trace_write_opened(rqstp, fhp, offset, vlen);
|
||||||
if (cnt)
|
if (cnt)
|
||||||
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen,
|
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen,
|
||||||
cnt, stablep);
|
cnt, stable);
|
||||||
trace_write_io_done(rqstp, fhp, offset, vlen);
|
trace_write_io_done(rqstp, fhp, offset, vlen);
|
||||||
fput(file);
|
fput(file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,11 +84,11 @@ __be32 nfsd_readv(struct file *, loff_t, struct kvec *, int,
|
||||||
__be32 nfsd_read(struct svc_rqst *, struct svc_fh *,
|
__be32 nfsd_read(struct svc_rqst *, struct svc_fh *,
|
||||||
loff_t, struct kvec *, int, unsigned long *);
|
loff_t, struct kvec *, int, unsigned long *);
|
||||||
__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
|
__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
|
||||||
loff_t, struct kvec *,int, unsigned long *, int *);
|
loff_t, struct kvec *,int, unsigned long *, int);
|
||||||
__be32 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
|
__be32 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
|
||||||
struct file *file, loff_t offset,
|
struct file *file, loff_t offset,
|
||||||
struct kvec *vec, int vlen, unsigned long *cnt,
|
struct kvec *vec, int vlen, unsigned long *cnt,
|
||||||
int *stablep);
|
int stable);
|
||||||
__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
|
__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
|
||||||
char *, int *);
|
char *, int *);
|
||||||
__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
|
__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
|
||||||
|
|
Loading…
Reference in New Issue