diff options
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 0fd1efaf1cf..1855e8fea42 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -493,3 +493,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) PAGE_SIZE - 1) >> PAGE_SHIFT; } +/* + * Convert a struct timespec into a 64-bit change attribute + * + * This does approximately the same thing as timespec_to_ns(), + * but for calculation efficiency, we multiply the seconds by + * 1024*1024*1024. + */ +static inline +u64 nfs_timespec_to_change_attr(const struct timespec *ts) +{ + return ((u64)ts->tv_sec << 30) + ts->tv_nsec; +} |