summaryrefslogtreecommitdiff
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
authorMaxim Patlasov <MPatlasov@parallels.com>2014-04-28 14:19:24 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2014-04-28 14:19:24 +0200
commitab9e13f7c771b511d8f71666e83cb27bcc635b98 (patch)
treebc213ba010921446b018d89a72c317a6eb51c32f /fs/fuse/dir.c
parente27c9d3877a0d0479711a55f5cdd7ee91442da53 (diff)
downloadlinux-ab9e13f7c771b511d8f71666e83cb27bcc635b98.tar.gz
fuse: allow ctime flushing to userspace
The patch extends fuse_setattr_in, and extends the flush procedure (fuse_flush_times()) called on ->write_inode() to send the ctime as well as mtime. Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 8c233834591f..e6ba579e2937 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1597,7 +1597,7 @@ static void fuse_setattr_fill(struct fuse_conn *fc, struct fuse_req *req,
/*
* Flush inode->i_mtime to the server
*/
-int fuse_flush_mtime(struct inode *inode, struct fuse_file *ff)
+int fuse_flush_times(struct inode *inode, struct fuse_file *ff)
{
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_req *req;
@@ -1612,9 +1612,14 @@ int fuse_flush_mtime(struct inode *inode, struct fuse_file *ff)
memset(&inarg, 0, sizeof(inarg));
memset(&outarg, 0, sizeof(outarg));
- inarg.valid |= FATTR_MTIME;
+ inarg.valid = FATTR_MTIME;
inarg.mtime = inode->i_mtime.tv_sec;
inarg.mtimensec = inode->i_mtime.tv_nsec;
+ if (fc->minor >= 23) {
+ inarg.valid |= FATTR_CTIME;
+ inarg.ctime = inode->i_ctime.tv_sec;
+ inarg.ctimensec = inode->i_ctime.tv_nsec;
+ }
if (ff) {
inarg.valid |= FATTR_FH;
inarg.fh = ff->fh;