aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2009-07-02 12:26:36 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2009-07-02 12:26:36 +0000
commit24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6 (patch)
tree0ebcdf18f18a07ab444c4707f8091b615fd23171 /lib/fuse.c
parent5bd3ba41e55e8c52e04d730d1e8a924b23b21591 (diff)
downloadlibfuse-24b35c3d97ffdbf0a1f8e8b4e94ed892343603a6.tar.gz
* The context is extended with a 'umask' field. The umask is sent
for mknod, mkdir and create requests by linux kernel version 2.6.31 or later, otherwise the umask is set to zero. Also introduce a new feature flag: FUSE_CAP_DONT_MASK. If the kernel supports this feature, then this flag will be set in conn->capable in the ->init() method. If the filesystem sets this flag in in conn->want, then the create modes will not be masked. * Add low level interfaces for lookup cache and attribute invalidation. This feature is available in linux kernels 2.6.31 or later. Patch by John Muir * Kernel interface version is now 7.12
Diffstat (limited to 'lib/fuse.c')
-rw-r--r--lib/fuse.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index dad9a71..68cb603 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -1422,8 +1422,10 @@ int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode,
int err;
if (fs->debug)
- fprintf(stderr, "create flags: 0x%x %s\n", fi->flags,
- path);
+ fprintf(stderr,
+ "create flags: 0x%x %s 0%o umask=0%03o\n",
+ fi->flags, path, mode,
+ fuse_get_context()->umask);
err = fs->op.create(path, mode, fi);
@@ -1572,8 +1574,9 @@ int fuse_fs_mknod(struct fuse_fs *fs, const char *path, mode_t mode,
fuse_get_context()->private_data = fs->user_data;
if (fs->op.mknod) {
if (fs->debug)
- fprintf(stderr, "mknod %s 0%o 0x%llx\n", path,
- mode, (unsigned long long) rdev);
+ fprintf(stderr, "mknod %s 0%o 0x%llx umask=0%03o\n",
+ path, mode, (unsigned long long) rdev,
+ fuse_get_context()->umask);
return fs->op.mknod(path, mode, rdev);
} else {
@@ -1586,7 +1589,8 @@ int fuse_fs_mkdir(struct fuse_fs *fs, const char *path, mode_t mode)
fuse_get_context()->private_data = fs->user_data;
if (fs->op.mkdir) {
if (fs->debug)
- fprintf(stderr, "mkdir %s 0%o\n", path, mode);
+ fprintf(stderr, "mkdir %s 0%o umask=0%03o\n",
+ path, mode, fuse_get_context()->umask);
return fs->op.mkdir(path, mode);
} else {
@@ -1909,6 +1913,7 @@ static struct fuse *req_fuse_prepare(fuse_req_t req)
c->ctx.uid = ctx->uid;
c->ctx.gid = ctx->gid;
c->ctx.pid = ctx->pid;
+ c->ctx.umask = ctx->umask;
return c->ctx.fuse;
}