diff options
author | J. Bruce Fields <bfields@redhat.com> | 2020-11-30 23:46:16 +0100 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2020-12-09 15:39:37 +0100 |
commit | 4b03d99794eeed27650597a886247c6427ce1055 (patch) | |
tree | f6f832964583f8ef0c8f2b41b143914a4dcc1d13 /fs/nfsd/nfsfh.h | |
parent | nfsd: simplify nfsd4_change_info (diff) | |
download | linux-4b03d99794eeed27650597a886247c6427ce1055.tar.xz linux-4b03d99794eeed27650597a886247c6427ce1055.zip |
nfsd: minor nfsd4_change_attribute cleanup
Minor cleanup, no change in behavior.
Also pull out a common helper that'll be useful elsewhere.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfsfh.h')
-rw-r--r-- | fs/nfsd/nfsfh.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h index 39d764b129fa..45bd776290d5 100644 --- a/fs/nfsd/nfsfh.h +++ b/fs/nfsd/nfsfh.h @@ -259,19 +259,16 @@ fh_clear_wcc(struct svc_fh *fhp) static inline u64 nfsd4_change_attribute(struct kstat *stat, struct inode *inode) { - u64 chattr; - if (IS_I_VERSION(inode)) { + u64 chattr; + chattr = stat->ctime.tv_sec; chattr <<= 30; chattr += stat->ctime.tv_nsec; chattr += inode_query_iversion(inode); - } else { - chattr = stat->ctime.tv_sec; - chattr <<= 32; - chattr += stat->ctime.tv_nsec; - } - return chattr; + return chattr; + } else + return time_to_chattr(&stat->ctime); } extern void fill_pre_wcc(struct svc_fh *fhp); |