mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
NFSD: Update the NFSv3 COMMIT3res encoder to use struct xdr_stream
As an additional clean up, encode_wcc_data() is removed because it is now no longer used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
@@ -432,14 +432,6 @@ encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __be32 *
|
|
||||||
encode_saved_post_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
|
|
||||||
{
|
|
||||||
/* Attributes to follow */
|
|
||||||
*p++ = xdr_one;
|
|
||||||
return encode_fattr3(rqstp, p, fhp, &fhp->fh_post_attr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
svcxdr_encode_wcc_attr(struct xdr_stream *xdr, const struct svc_fh *fhp)
|
svcxdr_encode_wcc_attr(struct xdr_stream *xdr, const struct svc_fh *fhp)
|
||||||
{
|
{
|
||||||
@@ -562,30 +554,6 @@ neither:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Enocde weak cache consistency data
|
|
||||||
*/
|
|
||||||
static __be32 *
|
|
||||||
encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
|
|
||||||
{
|
|
||||||
struct dentry *dentry = fhp->fh_dentry;
|
|
||||||
|
|
||||||
if (dentry && d_really_is_positive(dentry) && fhp->fh_post_saved) {
|
|
||||||
if (fhp->fh_pre_saved) {
|
|
||||||
*p++ = xdr_one;
|
|
||||||
p = xdr_encode_hyper(p, (u64) fhp->fh_pre_size);
|
|
||||||
p = encode_time3(p, &fhp->fh_pre_mtime);
|
|
||||||
p = encode_time3(p, &fhp->fh_pre_ctime);
|
|
||||||
} else {
|
|
||||||
*p++ = xdr_zero;
|
|
||||||
}
|
|
||||||
return encode_saved_post_attr(rqstp, p, fhp);
|
|
||||||
}
|
|
||||||
/* no pre- or post-attrs */
|
|
||||||
*p++ = xdr_zero;
|
|
||||||
return encode_post_op_attr(rqstp, p, fhp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool fs_supports_change_attribute(struct super_block *sb)
|
static bool fs_supports_change_attribute(struct super_block *sb)
|
||||||
{
|
{
|
||||||
return sb->s_flags & SB_I_VERSION || sb->s_export_op->fetch_iversion;
|
return sb->s_flags & SB_I_VERSION || sb->s_export_op->fetch_iversion;
|
||||||
@@ -1548,16 +1516,24 @@ nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p)
|
|||||||
int
|
int
|
||||||
nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p)
|
nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p)
|
||||||
{
|
{
|
||||||
|
struct xdr_stream *xdr = &rqstp->rq_res_stream;
|
||||||
struct nfsd3_commitres *resp = rqstp->rq_resp;
|
struct nfsd3_commitres *resp = rqstp->rq_resp;
|
||||||
|
|
||||||
*p++ = resp->status;
|
if (!svcxdr_encode_nfsstat3(xdr, resp->status))
|
||||||
p = encode_wcc_data(rqstp, p, &resp->fh);
|
return 0;
|
||||||
/* Write verifier */
|
switch (resp->status) {
|
||||||
if (resp->status == 0) {
|
case nfs_ok:
|
||||||
*p++ = resp->verf[0];
|
if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh))
|
||||||
*p++ = resp->verf[1];
|
return 0;
|
||||||
|
if (!svcxdr_encode_writeverf3(xdr, resp->verf))
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh))
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return xdr_ressize_check(rqstp, p);
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user