diff options
| -rw-r--r-- | fs/fuse/dir.c | 9 | ||||
| -rw-r--r-- | fs/fuse/file.c | 2 | ||||
| -rw-r--r-- | fs/fuse/fuse_i.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/fuse.h | 7 |
4 files changed, 14 insertions, 6 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, | |||
| 1597 | /* | 1597 | /* |
| 1598 | * Flush inode->i_mtime to the server | 1598 | * Flush inode->i_mtime to the server |
| 1599 | */ | 1599 | */ |
| 1600 | int fuse_flush_mtime(struct inode *inode, struct fuse_file *ff) | 1600 | int fuse_flush_times(struct inode *inode, struct fuse_file *ff) |
| 1601 | { | 1601 | { |
| 1602 | struct fuse_conn *fc = get_fuse_conn(inode); | 1602 | struct fuse_conn *fc = get_fuse_conn(inode); |
| 1603 | struct fuse_req *req; | 1603 | struct fuse_req *req; |
| @@ -1612,9 +1612,14 @@ int fuse_flush_mtime(struct inode *inode, struct fuse_file *ff) | |||
| 1612 | memset(&inarg, 0, sizeof(inarg)); | 1612 | memset(&inarg, 0, sizeof(inarg)); |
| 1613 | memset(&outarg, 0, sizeof(outarg)); | 1613 | memset(&outarg, 0, sizeof(outarg)); |
| 1614 | 1614 | ||
| 1615 | inarg.valid |= FATTR_MTIME; | 1615 | inarg.valid = FATTR_MTIME; |
| 1616 | inarg.mtime = inode->i_mtime.tv_sec; | 1616 | inarg.mtime = inode->i_mtime.tv_sec; |
| 1617 | inarg.mtimensec = inode->i_mtime.tv_nsec; | 1617 | inarg.mtimensec = inode->i_mtime.tv_nsec; |
| 1618 | if (fc->minor >= 23) { | ||
| 1619 | inarg.valid |= FATTR_CTIME; | ||
| 1620 | inarg.ctime = inode->i_ctime.tv_sec; | ||
| 1621 | inarg.ctimensec = inode->i_ctime.tv_nsec; | ||
| 1622 | } | ||
| 1618 | if (ff) { | 1623 | if (ff) { |
| 1619 | inarg.valid |= FATTR_FH; | 1624 | inarg.valid |= FATTR_FH; |
| 1620 | inarg.fh = ff->fh; | 1625 | inarg.fh = ff->fh; |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d228c3962ffd..96d513e01a5d 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
| @@ -1691,7 +1691,7 @@ int fuse_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
| 1691 | int err; | 1691 | int err; |
| 1692 | 1692 | ||
| 1693 | ff = __fuse_write_file_get(fc, fi); | 1693 | ff = __fuse_write_file_get(fc, fi); |
| 1694 | err = fuse_flush_mtime(inode, ff); | 1694 | err = fuse_flush_times(inode, ff); |
| 1695 | if (ff) | 1695 | if (ff) |
| 1696 | fuse_file_put(ff, 0); | 1696 | fuse_file_put(ff, 0); |
| 1697 | 1697 | ||
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index d2f10054b9a1..40677e33504f 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
| @@ -889,7 +889,7 @@ int fuse_dev_release(struct inode *inode, struct file *file); | |||
| 889 | 889 | ||
| 890 | bool fuse_write_update_size(struct inode *inode, loff_t pos); | 890 | bool fuse_write_update_size(struct inode *inode, loff_t pos); |
| 891 | 891 | ||
| 892 | int fuse_flush_mtime(struct inode *inode, struct fuse_file *ff); | 892 | int fuse_flush_times(struct inode *inode, struct fuse_file *ff); |
| 893 | int fuse_write_inode(struct inode *inode, struct writeback_control *wbc); | 893 | int fuse_write_inode(struct inode *inode, struct writeback_control *wbc); |
| 894 | 894 | ||
| 895 | int fuse_do_setattr(struct inode *inode, struct iattr *attr, | 895 | int fuse_do_setattr(struct inode *inode, struct iattr *attr, |
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index d1b4e2ca9672..e86a21acef75 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h | |||
| @@ -98,6 +98,8 @@ | |||
| 98 | * - add FUSE_WRITEBACK_CACHE | 98 | * - add FUSE_WRITEBACK_CACHE |
| 99 | * - add time_gran to fuse_init_out | 99 | * - add time_gran to fuse_init_out |
| 100 | * - add reserved space to fuse_init_out | 100 | * - add reserved space to fuse_init_out |
| 101 | * - add FATTR_CTIME | ||
| 102 | * - add ctime and ctimensec to fuse_setattr_in | ||
| 101 | */ | 103 | */ |
| 102 | 104 | ||
| 103 | #ifndef _LINUX_FUSE_H | 105 | #ifndef _LINUX_FUSE_H |
| @@ -193,6 +195,7 @@ struct fuse_file_lock { | |||
| 193 | #define FATTR_ATIME_NOW (1 << 7) | 195 | #define FATTR_ATIME_NOW (1 << 7) |
| 194 | #define FATTR_MTIME_NOW (1 << 8) | 196 | #define FATTR_MTIME_NOW (1 << 8) |
| 195 | #define FATTR_LOCKOWNER (1 << 9) | 197 | #define FATTR_LOCKOWNER (1 << 9) |
| 198 | #define FATTR_CTIME (1 << 10) | ||
| 196 | 199 | ||
| 197 | /** | 200 | /** |
| 198 | * Flags returned by the OPEN request | 201 | * Flags returned by the OPEN request |
| @@ -440,10 +443,10 @@ struct fuse_setattr_in { | |||
| 440 | uint64_t lock_owner; | 443 | uint64_t lock_owner; |
| 441 | uint64_t atime; | 444 | uint64_t atime; |
| 442 | uint64_t mtime; | 445 | uint64_t mtime; |
| 443 | uint64_t unused2; | 446 | uint64_t ctime; |
| 444 | uint32_t atimensec; | 447 | uint32_t atimensec; |
| 445 | uint32_t mtimensec; | 448 | uint32_t mtimensec; |
| 446 | uint32_t unused3; | 449 | uint32_t ctimensec; |
| 447 | uint32_t mode; | 450 | uint32_t mode; |
| 448 | uint32_t unused4; | 451 | uint32_t unused4; |
| 449 | uint32_t uid; | 452 | uint32_t uid; |
