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 0fd1efaf1cff..1855e8fea423 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) | |||
493 | PAGE_SIZE - 1) >> PAGE_SHIFT; | 493 | PAGE_SIZE - 1) >> PAGE_SHIFT; |
494 | } | 494 | } |
495 | 495 | ||
496 | /* | ||
497 | * Convert a struct timespec into a 64-bit change attribute | ||
498 | * | ||
499 | * This does approximately the same thing as timespec_to_ns(), | ||
500 | * but for calculation efficiency, we multiply the seconds by | ||
501 | * 1024*1024*1024. | ||
502 | */ | ||
503 | static inline | ||
504 | u64 nfs_timespec_to_change_attr(const struct timespec *ts) | ||
505 | { | ||
506 | return ((u64)ts->tv_sec << 30) + ts->tv_nsec; | ||
507 | } | ||