aboutsummaryrefslogtreecommitdiff
path: root/fs/logfs/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-17 13:53:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-17 13:53:35 -0700
commit7d32c0aca4fbd0319c860d12af5fae3e88c760e6 (patch)
tree3df9712c128a98916601a98510e5160dac809264 /fs/logfs/super.c
parent3d2c978e0cd8b1157f9eebd13062d61fb7a75ad5 (diff)
parent6f485b41875dbf5160c1990322469c1f65f77b28 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/joern/logfs
* git://git.kernel.org/pub/scm/linux/kernel/git/joern/logfs: logfs: handle powerfail on NAND flash logfs: handle errors from get_mtd_device() logfs: remove unused variable logfs: fix sync logfs: fix compile failure logfs: initialize li->li_refcount logfs: commit reservations under space pressure logfs: survive logfs_buf_recover read errors logfs: Close i_ino reuse race logfs: fix logfs_seek_hole() logfs: Return -EINVAL if filesystem image doesn't match LogFS: Fix typo in b6349ac8 logfs: testing the wrong variable
Diffstat (limited to 'fs/logfs/super.c')
-rw-r--r--fs/logfs/super.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index d7c23ed8349..d651e10a1e9 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -138,10 +138,14 @@ static int logfs_sb_set(struct super_block *sb, void *_super)
sb->s_fs_info = super;
sb->s_mtd = super->s_mtd;
sb->s_bdev = super->s_bdev;
+#ifdef CONFIG_BLOCK
if (sb->s_bdev)
sb->s_bdi = &bdev_get_queue(sb->s_bdev)->backing_dev_info;
+#endif
+#ifdef CONFIG_MTD
if (sb->s_mtd)
sb->s_bdi = sb->s_mtd->backing_dev_info;
+#endif
return 0;
}
@@ -382,7 +386,7 @@ static struct page *find_super_block(struct super_block *sb)
if (!first || IS_ERR(first))
return NULL;
last = super->s_devops->find_last_sb(sb, &super->s_sb_ofs[1]);
- if (!last || IS_ERR(first)) {
+ if (!last || IS_ERR(last)) {
page_cache_release(first);
return NULL;
}
@@ -413,7 +417,7 @@ static int __logfs_read_sb(struct super_block *sb)
page = find_super_block(sb);
if (!page)
- return -EIO;
+ return -EINVAL;
ds = page_address(page);
super->s_size = be64_to_cpu(ds->ds_filesystem_size);