Beispiel #1
0
static int volicon_rename(const char *from, const char *to)
{
    ERROR_IF_MAGIC_FILE(from, EACCES);
    ERROR_IF_MAGIC_FILE(to, EACCES);

    return fuse_fs_rename(volicon_get()->next, from, to);
}
Beispiel #2
0
static int volicon_exchange(const char *path1, const char *path2,
                            unsigned long options)
{
    ERROR_IF_MAGIC_FILE(path1, EACCES);
    ERROR_IF_MAGIC_FILE(path2, EACCES);

    return fuse_fs_exchange(volicon_get()->next, path1, path2, options);
}
Beispiel #3
0
static int
volicon_symlink(const char *from, const char *path)
{
    ERROR_IF_MAGIC_FILE(path, EEXIST);

    return fuse_fs_symlink(volicon_get()->next, from, path);
}
Beispiel #4
0
static int
volicon_unlink(const char *path)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_unlink(volicon_get()->next, path);
}
Beispiel #5
0
static int
volicon_rmdir(const char *path)
{
    ERROR_IF_MAGIC_FILE(path, ENOTDIR);

    return fuse_fs_rmdir(volicon_get()->next, path);
}
Beispiel #6
0
static int
volicon_mkdir(const char *path, mode_t mode)
{
    ERROR_IF_MAGIC_FILE(path, EEXIST);

    return fuse_fs_mkdir(volicon_get()->next, path, mode);
}
Beispiel #7
0
static int
volicon_mknod(const char *path, mode_t mode, dev_t rdev)
{
    ERROR_IF_MAGIC_FILE(path, EEXIST);

    return fuse_fs_mknod(volicon_get()->next, path, mode, rdev);
}
Beispiel #8
0
static int
volicon_readlink(const char *path, char *buf, size_t size)
{
    ERROR_IF_MAGIC_FILE(path, EINVAL);

    return fuse_fs_readlink(volicon_get()->next, path, buf, size);
}
Beispiel #9
0
static int
volicon_setattr_x(const char *path, struct setattr_x *attr)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_setattr_x(volicon_get()->next, path, attr);
}
Beispiel #10
0
static int
volicon_chown(const char *path, uid_t uid, gid_t gid)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_chown(volicon_get()->next, path, uid, gid);
}
Beispiel #11
0
static int
volicon_bmap(const char *path, size_t blocksize, uint64_t *idx)
{
    ERROR_IF_MAGIC_FILE(path, ENOTSUP);

    return fuse_fs_bmap(volicon_get()->next, path, blocksize, idx);
}
Beispiel #12
0
static int
volicon_fsyncdir(const char *path, int isdatasync, struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, ENOTDIR);

    return fuse_fs_fsyncdir(volicon_get()->next, path, isdatasync, fi);
}
Beispiel #13
0
static int
volicon_chflags(const char *path, uint32_t flags)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_chflags(volicon_get()->next, path, flags);
}
Beispiel #14
0
static int
volicon_releasedir(const char *path, struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, ENOTDIR);

    return fuse_fs_releasedir(volicon_get()->next, path, fi);
}
Beispiel #15
0
static int
volicon_ftruncate(const char *path, off_t size, struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_ftruncate(volicon_get()->next, path, size, fi);
}
Beispiel #16
0
static int
volicon_flush(const char *path, struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, 0);

    return fuse_fs_flush(volicon_get()->next, path, fi);
}
Beispiel #17
0
static int
volicon_utimens(const char *path, const struct timespec ts[2])
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_utimens(volicon_get()->next, path, ts);
}
Beispiel #18
0
static int
volicon_truncate(const char *path, off_t size)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_truncate(volicon_get()->next, path, size);
}
Beispiel #19
0
static int
volicon_chmod(const char *path, mode_t mode)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_chmod(volicon_get()->next, path, mode);
}
Beispiel #20
0
static int
volicon_setcrtime(const char *path, const struct timespec *crtime)
{
    ERROR_IF_MAGIC_FILE(path, EPERM);

    return fuse_fs_setcrtime(volicon_get()->next, path, crtime);
}
Beispiel #21
0
static int
volicon_create(const char *path, mode_t mode, struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, EEXIST);

    return fuse_fs_create(volicon_get()->next, path, mode, fi);
}
Beispiel #22
0
static int
volicon_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
                off_t offset, struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, ENOTDIR);

    return fuse_fs_readdir(volicon_get()->next, path, buf, filler, offset, fi);
}
Beispiel #23
0
static int
volicon_write(const char *path, const char *buf, size_t size, off_t off,
              struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_write(volicon_get()->next, path, buf, size, off, fi);
}
Beispiel #24
0
static int
volicon_fallocate(const char *path, int mode, off_t offset, off_t length,
		  struct fuse_file_info *fi)
{
	ERROR_IF_MAGIC_FILE(path, ENOTSUP);

	return fuse_fs_fallocate(volicon_get()->next, path, mode, offset, length, fi);
}
Beispiel #25
0
static int
volicon_write_buf(const char *path, struct fuse_bufvec *buf, off_t offset,
		  struct fuse_file_info *fi)
{
	ERROR_IF_MAGIC_FILE(path, EACCES);

	return fuse_fs_write_buf(volicon_get()->next, path, buf, offset, fi);
}
Beispiel #26
0
static int
volicon_fsetattr_x(const char *path, struct setattr_x *attr,
		   struct fuse_file_info *fi)
{
    ERROR_IF_MAGIC_FILE(path, EACCES);

    return fuse_fs_fsetattr_x(volicon_get()->next, path, attr, fi);
}
Beispiel #27
0
static int
volicon_lock(const char *path, struct fuse_file_info *fi, int cmd,
             struct flock *lock)
{
    ERROR_IF_MAGIC_FILE(path, ENOTSUP);

    return fuse_fs_lock(volicon_get()->next, path, fi, cmd, lock);
}
Beispiel #28
0
static int
volicon_removexattr(const char *path, const char *name)
{
    ERROR_IF_MAGIC_FILE(path, EPERM);

    if ((strcmp(path, VOLICON_ROOT_MAGIC_PATH) == 0) &&
        (strcmp(name, XATTR_FINDERINFO_NAME) == 0)) {
        return -EACCES;
    }

    return fuse_fs_removexattr(volicon_get()->next, path, name);
}
Beispiel #29
0
static int
volicon_setxattr(const char *path, const char *name, const char *value,
                 size_t size, int flags, uint32_t position)
{
    ERROR_IF_MAGIC_FILE(path, EPERM);

    if ((strcmp(path, VOLICON_ROOT_MAGIC_PATH) == 0) &&
        (strcmp(name, XATTR_FINDERINFO_NAME) == 0)) {
        if ((size >= 8) && (size <= XATTR_FINDERINFO_SIZE)) {
            char finder_info[XATTR_FINDERINFO_SIZE];
            memcpy(finder_info, value, size);
            ((struct FndrGenericInfo *)&finder_info)->flags |= ntohs(0x0400);
            //finder_info[8] |= 0x100;
            return fuse_fs_setxattr(volicon_get()->next, path, name,
                                    finder_info, size, flags, position);
        }
    }

    return fuse_fs_setxattr(volicon_get()->next, path, name, value, size,
                            flags, position);
}
Beispiel #30
0
static int
volicon_getxattr(const char *path, const char *name, char *value, size_t size,
                 uint32_t position)
{
    ERROR_IF_MAGIC_FILE(path, EPERM);

    ssize_t res = 0;

    if ((strcmp(path, VOLICON_ROOT_MAGIC_PATH) == 0) &&
        (strcmp(name, XATTR_FINDERINFO_NAME) == 0)) {

        if (!size || !value) {
            return XATTR_FINDERINFO_SIZE;
        }

        if (size < XATTR_FINDERINFO_SIZE) {
            return -ERANGE;
        }

        res = fuse_fs_getxattr(volicon_get()->next, path, name, value, size,
                               position);

        if (res != XATTR_FINDERINFO_SIZE) {
            memcpy(value, finder_info, XATTR_FINDERINFO_SIZE);
        }

        ((struct FndrGenericInfo *)value)->flags |= ntohs(0x0400);

        return XATTR_FINDERINFO_SIZE;
    }

    res = fuse_fs_getxattr(volicon_get()->next, path, name, value, size,
                           position);

    if (res == -ENOSYS) {
        res = -ENOTSUP;
    }

    return res;
}