diff options
author | Csaba Henk <csaba@redhat.com> | 2018-05-03 10:22:18 +0200 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-05-04 17:42:12 +0000 |
commit | 2ac79ed8048753dfd2494d3a4d3b0e9411673e3a (patch) | |
tree | 080da10738f9dade1fcb787d43f333c641dffe04 /libglusterfs | |
parent | 15866ac9773e89cd9e017e7d3bf8aa01a87edfd8 (diff) |
fuse: add support for kernel writeback cache
- Added kernel-writeback-cache command line and xlator
option for requesting utilisation of the writeback
cache of the kernel in FUSE_INIT (see [1]).
- Added attr-times-granularity command line and xlator
option via which granularity of the {a,m,c}time in
stat (attr) data that we support can be indicated to
kernel. This is a means to avoid divergence of the
attr times between kernel and userspace that could
occur with writeback-cache, while still maintaining
maximum time precision the FUSE server is capable of
(see [2]).
- Handling FATTR_CTIME flag in FUSE_SETATTR that
indicates presence of ctime in setattr payload.
Currently we cannot associate arbitrary ctimes to
files on backend, so we just touch them to update
their ctimes to current time. Having ctimes in setattr
payload is also a side effect of writeback cache
(see [3] and [4]).
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4d99ff8,
"fuse: Turn writeback cache on"
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e27c9d3,
"fuse: fuse: add time_gran to INIT_OUT"
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1e18bda,
"fuse: add .write_inode"
[4]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab9e13f,
"fuse: allow ctime flushing to userspace"
Updates: #435
Change-Id: Id174c8e0c815c4456c35f8c53e41a6a507d91855
Signed-off-by: Csaba Henk <csaba@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/glusterfs.h | 4 | ||||
-rw-r--r-- | libglusterfs/src/xlator.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 904d4b60d75..90f2762b990 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -532,6 +532,10 @@ struct _cmd_args { char *event_history; int thin_client; uint32_t reader_thread_count; + + /* FUSE writeback cache support */ + int kernel_writeback_cache; + uint32_t attr_times_granularity; }; typedef struct _cmd_args cmd_args_t; diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index 4f18d1cd2a9..d476cf26442 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -33,6 +33,7 @@ #define GF_SET_ATTR_SIZE 0x8 #define GF_SET_ATTR_ATIME 0x10 #define GF_SET_ATTR_MTIME 0x20 +#define GF_SET_ATTR_CTIME 0x40 #define gf_attr_mode_set(mode) ((mode) & GF_SET_ATTR_MODE) #define gf_attr_uid_set(mode) ((mode) & GF_SET_ATTR_UID) |