summaryrefslogtreecommitdiff
path: root/fs/tabfs.c
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2021-04-06 13:48:48 -0700
committerOmar Rizwan <omar@omar.website>2021-04-06 13:48:48 -0700
commitb948c235b83e43441faeed257cfdffa2008326d9 (patch)
treed98da8af43b0a5a41bf04fb968a705b91fa410aa /fs/tabfs.c
parent8fbfa9a7c96b1de1e3e8416cb0bfc2b27c0b235d (diff)
downloadTabFS-b948c235b83e43441faeed257cfdffa2008326d9.tar.gz
TabFS-b948c235b83e43441faeed257cfdffa2008326d9.zip
fs,extension: Make truncate work on cached file content.
We now remember the path of each cached file, so when someone truncates that path, we can truncate all open instances of it in cache. Important when someone pipes to stomp a file / opens with O_TRUNC (which FUSE disaggregates into an open() and then a truncate() call). Gets rid of the need for FUSE_CAP_ATOMIC_O_TRUNC, which never worked on macOS anyway. Fixes #40.
Diffstat (limited to 'fs/tabfs.c')
-rw-r--r--fs/tabfs.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/fs/tabfs.c b/fs/tabfs.c
index a7936eb..c74becf 100644
--- a/fs/tabfs.c
+++ b/fs/tabfs.c
@@ -423,20 +423,6 @@ static int tabfs_mknod(const char *path, mode_t mode, dev_t rdev) {
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,
@@ -455,8 +441,6 @@ static const struct fuse_operations tabfs_oper = {
.mkdir = tabfs_mkdir,
.mknod = tabfs_mknod,
-
- .init = tabfs_init,
};
int main(int argc, char **argv) {