Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42774
b: refs/heads/master
c: d6392f8
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Dec 7, 2006
1 parent 3183aee commit edd5a9c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bdcf25080438ba71bb24b885e7c102de72c25c9d
refs/heads/master: d6392f873f1d09974d5c92c52715fa422ad7c625
16 changes: 16 additions & 0 deletions trunk/Documentation/filesystems/fuse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ homepage:

http://fuse.sourceforge.net/

Filesystem type
~~~~~~~~~~~~~~~

The filesystem type given to mount(2) can be one of the following:

'fuse'

This is the usual way to mount a FUSE filesystem. The first
argument of the mount system call may contain an arbitrary string,
which is not interpreted by the kernel.

'fuseblk'

The filesystem is block device based. The first argument of the
mount system call is interpreted as the name of the device.

Mount options
~~~~~~~~~~~~~

Expand Down
48 changes: 37 additions & 11 deletions trunk/fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,29 @@ static int fuse_get_sb(struct file_system_type *fs_type,
return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt);
}

static int fuse_get_sb_blk(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *raw_data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super,
mnt);
}

static struct file_system_type fuse_fs_type = {
.owner = THIS_MODULE,
.name = "fuse",
.get_sb = fuse_get_sb,
.kill_sb = kill_anon_super,
};

static struct file_system_type fuseblk_fs_type = {
.owner = THIS_MODULE,
.name = "fuseblk",
.get_sb = fuse_get_sb_blk,
.kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};

static decl_subsys(fuse, NULL, NULL);
static decl_subsys(connections, NULL, NULL);

Expand All @@ -617,24 +633,34 @@ static int __init fuse_fs_init(void)

err = register_filesystem(&fuse_fs_type);
if (err)
printk("fuse: failed to register filesystem\n");
else {
fuse_inode_cachep = kmem_cache_create("fuse_inode",
sizeof(struct fuse_inode),
0, SLAB_HWCACHE_ALIGN,
fuse_inode_init_once, NULL);
if (!fuse_inode_cachep) {
unregister_filesystem(&fuse_fs_type);
err = -ENOMEM;
}
}
goto out;

err = register_filesystem(&fuseblk_fs_type);
if (err)
goto out_unreg;

fuse_inode_cachep = kmem_cache_create("fuse_inode",
sizeof(struct fuse_inode),
0, SLAB_HWCACHE_ALIGN,
fuse_inode_init_once, NULL);
err = -ENOMEM;
if (!fuse_inode_cachep)
goto out_unreg2;

return 0;

out_unreg2:
unregister_filesystem(&fuseblk_fs_type);
out_unreg:
unregister_filesystem(&fuse_fs_type);
out:
return err;
}

static void fuse_fs_cleanup(void)
{
unregister_filesystem(&fuse_fs_type);
unregister_filesystem(&fuseblk_fs_type);
kmem_cache_destroy(fuse_inode_cachep);
}

Expand Down

0 comments on commit edd5a9c

Please sign in to comment.