Example #1
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);
}
Example #2
0
static int iconv_exchange(const char *path1, const char *path2,
			  unsigned long options)
{
	struct iconv *ic = iconv_get();
	char *new1;
	char *new2;
	int err = iconv_convpath(ic, path1, &new1, 0);
	if (!err) {
		err = iconv_convpath(ic, path2, &new2, 0);
		if (!err) {
			err = fuse_fs_exchange(ic->next, new1, new2, options);
			free(new1);
		}
		free(new2);
	}
	return err;
}
Example #3
0
static int subdir_exchange(const char *path1, const char *path2,
			   unsigned long options)
{
	struct subdir *d = subdir_get();
	char *new1;
	char *new2;
	int err;

	err = subdir_addpath(d, path1, &new1);
	if (err) {
		return err;
	}
	err = subdir_addpath(d, path2, &new2);
	if (err) {
		free(new1);
		return err;
	}
	err = fuse_fs_exchange(d->next, new1, new2, options);
	free(new1);
	free(new2);
	return err;
}