Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42778
b: refs/heads/master
c: 875d95e
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Dec 7, 2006
1 parent 069f663 commit 10181cc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 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: 0ec7ca41f6f0f74a394a7d686bc0ee8afef84887
refs/heads/master: 875d95ec9eb69ffb334116fb44d04d9a64dcbfbb
43 changes: 33 additions & 10 deletions trunk/fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,10 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
return -EINVAL;

if (is_bdev) {
#ifdef CONFIG_BLOCK
if (!sb_set_blocksize(sb, d.blksize))
return -EINVAL;
#endif
} else {
sb->s_blocksize = PAGE_CACHE_SIZE;
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
Expand Down Expand Up @@ -629,6 +631,14 @@ 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 struct file_system_type fuse_fs_type = {
.owner = THIS_MODULE,
.name = "fuse",
.get_sb = fuse_get_sb,
.kill_sb = kill_anon_super,
};

#ifdef CONFIG_BLOCK
static int fuse_get_sb_blk(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *raw_data, struct vfsmount *mnt)
Expand All @@ -637,13 +647,6 @@ static int fuse_get_sb_blk(struct file_system_type *fs_type,
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",
Expand All @@ -652,6 +655,26 @@ static struct file_system_type fuseblk_fs_type = {
.fs_flags = FS_REQUIRES_DEV,
};

static inline int register_fuseblk(void)
{
return register_filesystem(&fuseblk_fs_type);
}

static inline void unregister_fuseblk(void)
{
unregister_filesystem(&fuseblk_fs_type);
}
#else
static inline int register_fuseblk(void)
{
return 0;
}

static inline void unregister_fuseblk(void)
{
}
#endif

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

Expand All @@ -673,7 +696,7 @@ static int __init fuse_fs_init(void)
if (err)
goto out;

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

Expand All @@ -688,7 +711,7 @@ static int __init fuse_fs_init(void)
return 0;

out_unreg2:
unregister_filesystem(&fuseblk_fs_type);
unregister_fuseblk();
out_unreg:
unregister_filesystem(&fuse_fs_type);
out:
Expand All @@ -698,7 +721,7 @@ static int __init fuse_fs_init(void)
static void fuse_fs_cleanup(void)
{
unregister_filesystem(&fuse_fs_type);
unregister_filesystem(&fuseblk_fs_type);
unregister_fuseblk();
kmem_cache_destroy(fuse_inode_cachep);
}

Expand Down

0 comments on commit 10181cc

Please sign in to comment.