Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfsd: use timespec64 in encode_time_delta

The values in encode_time_delta are always small and don't
overflow the range of 'struct timespec', so changing it has
no effect.

Change it to timespec64 as a prerequisite for removing the
timespec definition later.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Arnd Bergmann and committed by
J. Bruce Fields
e4598e38 92c5e469

+2 -2
+2 -2
fs/nfsd/nfs4xdr.c
··· 2099 2099 */ 2100 2100 static __be32 *encode_time_delta(__be32 *p, struct inode *inode) 2101 2101 { 2102 - struct timespec ts; 2102 + struct timespec64 ts; 2103 2103 u32 ns; 2104 2104 2105 2105 ns = max_t(u32, NSEC_PER_SEC/HZ, inode->i_sb->s_time_gran); 2106 - ts = ns_to_timespec(ns); 2106 + ts = ns_to_timespec64(ns); 2107 2107 2108 2108 p = xdr_encode_hyper(p, ts.tv_sec); 2109 2109 *p++ = cpu_to_be32(ts.tv_nsec);