nfsd: simplify nfsd4_change_info
[ Upstream commit b2140338d8dca827ad9e83f3e026e9d51748b265 ] It doesn't make sense to carry all these extra fields around. Just make everything into change attribute from the start. This is just cleanup, there should be no change in behavior. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f8032b859d
commit
88dea0f92b
@ -2459,15 +2459,8 @@ static __be32 *encode_time_delta(__be32 *p, struct inode *inode)
|
|||||||
static __be32 *encode_cinfo(__be32 *p, struct nfsd4_change_info *c)
|
static __be32 *encode_cinfo(__be32 *p, struct nfsd4_change_info *c)
|
||||||
{
|
{
|
||||||
*p++ = cpu_to_be32(c->atomic);
|
*p++ = cpu_to_be32(c->atomic);
|
||||||
if (c->change_supported) {
|
p = xdr_encode_hyper(p, c->before_change);
|
||||||
p = xdr_encode_hyper(p, c->before_change);
|
p = xdr_encode_hyper(p, c->after_change);
|
||||||
p = xdr_encode_hyper(p, c->after_change);
|
|
||||||
} else {
|
|
||||||
*p++ = cpu_to_be32(c->before_ctime_sec);
|
|
||||||
*p++ = cpu_to_be32(c->before_ctime_nsec);
|
|
||||||
*p++ = cpu_to_be32(c->after_ctime_sec);
|
|
||||||
*p++ = cpu_to_be32(c->after_ctime_nsec);
|
|
||||||
}
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,7 @@ static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
|
|||||||
|
|
||||||
struct nfsd4_change_info {
|
struct nfsd4_change_info {
|
||||||
u32 atomic;
|
u32 atomic;
|
||||||
bool change_supported;
|
|
||||||
u32 before_ctime_sec;
|
|
||||||
u32 before_ctime_nsec;
|
|
||||||
u64 before_change;
|
u64 before_change;
|
||||||
u32 after_ctime_sec;
|
|
||||||
u32 after_ctime_nsec;
|
|
||||||
u64 after_change;
|
u64 after_change;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -754,15 +749,9 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
|
|||||||
{
|
{
|
||||||
BUG_ON(!fhp->fh_pre_saved);
|
BUG_ON(!fhp->fh_pre_saved);
|
||||||
cinfo->atomic = (u32)fhp->fh_post_saved;
|
cinfo->atomic = (u32)fhp->fh_post_saved;
|
||||||
cinfo->change_supported = IS_I_VERSION(d_inode(fhp->fh_dentry));
|
|
||||||
|
|
||||||
cinfo->before_change = fhp->fh_pre_change;
|
cinfo->before_change = fhp->fh_pre_change;
|
||||||
cinfo->after_change = fhp->fh_post_change;
|
cinfo->after_change = fhp->fh_post_change;
|
||||||
cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
|
|
||||||
cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
|
|
||||||
cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
|
|
||||||
cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user