Пример #1
0
static int subdir_getattr(const char *path, struct stat *stbuf)
{
	struct subdir *d = subdir_get();
	char *newpath;
	int err = subdir_addpath(d, path, &newpath);
	if (!err) {
		err = fuse_fs_getattr(d->next, newpath, stbuf);
		free(newpath);
	}
	return err;
}
Пример #2
0
static int iconv_getattr(const char *path, struct stat *stbuf)
{
	struct iconv *ic = iconv_get();
	char *newpath;
	int err = iconv_convpath(ic, path, &newpath, 0);
	if (!err) {
		err = fuse_fs_getattr(ic->next, newpath, stbuf);
		free(newpath);
	}
	return err;
}
Пример #3
0
static int
volicon_getattr(const char *path, struct stat *buf)
{
    int res = 0;

    if (volicon_is_icon_magic_file(path)) {

        memset((void *)buf, 0, sizeof(struct stat));

        buf->st_mode  = S_IFREG | 0444;
        buf->st_nlink = 1;
        buf->st_uid   = volicon_get()->volicon_uid;
        buf->st_gid = 0;
        buf->st_size  = volicon_get()->volicon_size;
        buf->st_atime = buf->st_ctime = buf->st_mtime = time(NULL);

    } else {
        res = fuse_fs_getattr(volicon_get()->next, path, buf);
    }

    return res;
}
Пример #4
0
static struct threadid *
threadid_get(void)
{
	return fuse_get_context()->private_data;
}

/*
 * FUSE API Operations
 * Listed in the same order as in struct fuse_operations in <fuse.h>
 */

static int
threadid_getattr(const char *path, struct stat *buf)
{
	THREADID_PRE()
	int res = fuse_fs_getattr(threadid_get()->next, path, buf);
	THREADID_POST()

	return res;
}

static int
threadid_readlink(const char *path, char *buf, size_t size)
{
	THREADID_PRE()
	int res = fuse_fs_readlink(threadid_get()->next, path, buf, size);
	THREADID_POST()

	return res;
}