diff options
author | Omar Rizwan <omar.rizwan@gmail.com> | 2021-01-12 00:16:29 -0800 |
---|---|---|
committer | Omar Rizwan <omar.rizwan@gmail.com> | 2021-01-12 00:16:29 -0800 |
commit | 9e1a145d23c313f8aa3b50986c331562542e8ba7 (patch) | |
tree | 9ace80d7d8ff8551313368357ef6e041bfc751b4 /fs | |
parent | 030336b8584ccde5f7052f896c627643981b1dce (diff) | |
parent | 8b0e106ebdce0020a3b7863061feb6a3eabe0c3f (diff) |
Merge branch 'huglovefan-truncate'
Diffstat (limited to 'fs')
-rw-r--r-- | fs/tabfs.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -423,6 +423,20 @@ static int tabfs_create(const char *path, mode_t mode, struct fuse_file_info *fi return 0; } +#define want_capability(conn, flag) \ + do { \ + if (conn->capable & flag) { \ + conn->want |= flag; \ + } else { \ + eprintln("warning: " #flag " not supported"); \ + } \ + } while (0) + +static void *tabfs_init(struct fuse_conn_info *conn) { + want_capability(conn, FUSE_CAP_ATOMIC_O_TRUNC); + return NULL; +} + static const struct fuse_operations tabfs_oper = { .getattr = tabfs_getattr, .readlink = tabfs_readlink, @@ -441,6 +455,8 @@ static const struct fuse_operations tabfs_oper = { .mkdir = tabfs_mkdir, .create = tabfs_create, + + .init = tabfs_init, }; int main(int argc, char **argv) { |