aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-12-06 23:35:54 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:32 -0500
commit875d95ec9eb69ffb334116fb44d04d9a64dcbfbb (patch)
tree7023768e791ca0301446a27e8a63df370ea09f03
parent0ec7ca41f6f0f74a394a7d686bc0ee8afef84887 (diff)
[PATCH] fuse: fix compile without CONFIG_BLOCK
Randy Dunlap wote: > Should FUSE depend on BLOCK? Without that and with BLOCK=n, I get: > > inode.c:(.text+0x3acc5): undefined reference to `sb_set_blocksize' > inode.c:(.text+0x3a393): undefined reference to `get_sb_bdev' > fs/built-in.o:(.data+0xd718): undefined reference to `kill_block_super Most fuse filesystems work fine without block device support, so I think a better solution is to disable the 'fuseblk' filesystem type if BLOCK=n. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/fuse/inode.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 437d61c65268..12450d2b320e 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -535,8 +535,10 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
535 return -EINVAL; 535 return -EINVAL;
536 536
537 if (is_bdev) { 537 if (is_bdev) {
538#ifdef CONFIG_BLOCK
538 if (!sb_set_blocksize(sb, d.blksize)) 539 if (!sb_set_blocksize(sb, d.blksize))
539 return -EINVAL; 540 return -EINVAL;
541#endif
540 } else { 542 } else {
541 sb->s_blocksize = PAGE_CACHE_SIZE; 543 sb->s_blocksize = PAGE_CACHE_SIZE;
542 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 544 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
@@ -629,6 +631,14 @@ static int fuse_get_sb(struct file_system_type *fs_type,
629 return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt); 631 return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt);
630} 632}
631 633
634static struct file_system_type fuse_fs_type = {
635 .owner = THIS_MODULE,
636 .name = "fuse",
637 .get_sb = fuse_get_sb,
638 .kill_sb = kill_anon_super,
639};
640
641#ifdef CONFIG_BLOCK
632static int fuse_get_sb_blk(struct file_system_type *fs_type, 642static int fuse_get_sb_blk(struct file_system_type *fs_type,
633 int flags, const char *dev_name, 643 int flags, const char *dev_name,
634 void *raw_data, struct vfsmount *mnt) 644 void *raw_data, struct vfsmount *mnt)
@@ -637,13 +647,6 @@ static int fuse_get_sb_blk(struct file_system_type *fs_type,
637 mnt); 647 mnt);
638} 648}
639 649
640static struct file_system_type fuse_fs_type = {
641 .owner = THIS_MODULE,
642 .name = "fuse",
643 .get_sb = fuse_get_sb,
644 .kill_sb = kill_anon_super,
645};
646
647static struct file_system_type fuseblk_fs_type = { 650static struct file_system_type fuseblk_fs_type = {
648 .owner = THIS_MODULE, 651 .owner = THIS_MODULE,
649 .name = "fuseblk", 652 .name = "fuseblk",
@@ -652,6 +655,26 @@ static struct file_system_type fuseblk_fs_type = {
652 .fs_flags = FS_REQUIRES_DEV, 655 .fs_flags = FS_REQUIRES_DEV,
653}; 656};
654 657
658static inline int register_fuseblk(void)
659{
660 return register_filesystem(&fuseblk_fs_type);
661}
662
663static inline void unregister_fuseblk(void)
664{
665 unregister_filesystem(&fuseblk_fs_type);
666}
667#else
668static inline int register_fuseblk(void)
669{
670 return 0;
671}
672
673static inline void unregister_fuseblk(void)
674{
675}
676#endif
677
655static decl_subsys(fuse, NULL, NULL); 678static decl_subsys(fuse, NULL, NULL);
656static decl_subsys(connections, NULL, NULL); 679static decl_subsys(connections, NULL, NULL);
657 680
@@ -673,7 +696,7 @@ static int __init fuse_fs_init(void)
673 if (err) 696 if (err)
674 goto out; 697 goto out;
675 698
676 err = register_filesystem(&fuseblk_fs_type); 699 err = register_fuseblk();
677 if (err) 700 if (err)
678 goto out_unreg; 701 goto out_unreg;
679 702
@@ -688,7 +711,7 @@ static int __init fuse_fs_init(void)
688 return 0; 711 return 0;
689 712
690 out_unreg2: 713 out_unreg2:
691 unregister_filesystem(&fuseblk_fs_type); 714 unregister_fuseblk();
692 out_unreg: 715 out_unreg:
693 unregister_filesystem(&fuse_fs_type); 716 unregister_filesystem(&fuse_fs_type);
694 out: 717 out:
@@ -698,7 +721,7 @@ static int __init fuse_fs_init(void)
698static void fuse_fs_cleanup(void) 721static void fuse_fs_cleanup(void)
699{ 722{
700 unregister_filesystem(&fuse_fs_type); 723 unregister_filesystem(&fuse_fs_type);
701 unregister_filesystem(&fuseblk_fs_type); 724 unregister_fuseblk();
702 kmem_cache_destroy(fuse_inode_cachep); 725 kmem_cache_destroy(fuse_inode_cachep);
703} 726}
704 727