[PATCH 07/16] fuse2fs: report nanoseconds resolution through getattr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

Report the nanonseconds component of timestamps via getattr, and tell
fuse that we actually support nanosecond granularity.

Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
---
 misc/fuse2fs.c |    6 ++++++
 1 file changed, 6 insertions(+)


diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index d56d51207d1f25..bf4e592e7d2782 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -586,6 +586,9 @@ static void *op_init(struct fuse_conn_info *conn
 	dbg_printf(ff, "%s: dev=%s\n", __func__, fs->device_name);
 #ifdef FUSE_CAP_IOCTL_DIR
 	conn->want |= FUSE_CAP_IOCTL_DIR;
+#endif
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+	conn->time_gran = 1;
 #endif
 	if (fs->flags & EXT2_FLAG_RW) {
 		fs->super->s_mnt_count++;
@@ -635,10 +638,13 @@ static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf)
 						(struct ext2_inode *)&inode);
 	EXT4_INODE_GET_XTIME(i_atime, &tv, &inode);
 	statbuf->st_atime = tv.tv_sec;
+	statbuf->st_atim.tv_nsec = tv.tv_nsec;
 	EXT4_INODE_GET_XTIME(i_mtime, &tv, &inode);
 	statbuf->st_mtime = tv.tv_sec;
+	statbuf->st_mtim.tv_nsec = tv.tv_nsec;
 	EXT4_INODE_GET_XTIME(i_ctime, &tv, &inode);
 	statbuf->st_ctime = tv.tv_sec;
+	statbuf->st_ctim.tv_nsec = tv.tv_nsec;
 	if (LINUX_S_ISCHR(inode.i_mode) ||
 	    LINUX_S_ISBLK(inode.i_mode)) {
 		if (inode.i_block[0])





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux