aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2010-02-02 17:04:30 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-15 12:06:05 -0400
commit6f72375ac0ed045feba16739884b849fe1222826 (patch)
tree0e9331301ef2455b8e145a5ace49124621f287fc /drivers
parente5c79cb177f440c4c6ed1ac63d09370da92a2a8d (diff)
Staging: Fixed pohmelfs regression because of per-bdi writeback.
commit 182374a0bddeef46769d2f8ab56fcccc433b96f3 upstream. Since pohmelfs isn't tied to a single block device, it needs to setup a backing dev like nfs/btrfs/etc do. Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/pohmelfs/inode.c20
-rw-r--r--drivers/staging/pohmelfs/netfs.h3
2 files changed, 21 insertions, 2 deletions
diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c
index f69b7783027f..cd2581107607 100644
--- a/drivers/staging/pohmelfs/inode.c
+++ b/drivers/staging/pohmelfs/inode.c
@@ -36,6 +36,7 @@
36#define POHMELFS_MAGIC_NUM 0x504f482e 36#define POHMELFS_MAGIC_NUM 0x504f482e
37 37
38static struct kmem_cache *pohmelfs_inode_cache; 38static struct kmem_cache *pohmelfs_inode_cache;
39static atomic_t psb_bdi_num = ATOMIC_INIT(0);
39 40
40/* 41/*
41 * Removes inode from all trees, drops local name cache and removes all queued 42 * Removes inode from all trees, drops local name cache and removes all queued
@@ -1331,6 +1332,8 @@ static void pohmelfs_put_super(struct super_block *sb)
1331 pohmelfs_crypto_exit(psb); 1332 pohmelfs_crypto_exit(psb);
1332 pohmelfs_state_exit(psb); 1333 pohmelfs_state_exit(psb);
1333 1334
1335 bdi_destroy(&psb->bdi);
1336
1334 kfree(psb); 1337 kfree(psb);
1335 sb->s_fs_info = NULL; 1338 sb->s_fs_info = NULL;
1336} 1339}
@@ -1815,11 +1818,22 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
1815 if (!psb) 1818 if (!psb)
1816 goto err_out_exit; 1819 goto err_out_exit;
1817 1820
1821 err = bdi_init(&psb->bdi);
1822 if (err)
1823 goto err_out_free_sb;
1824
1825 err = bdi_register(&psb->bdi, NULL, "pfs-%d", atomic_inc_return(&psb_bdi_num));
1826 if (err) {
1827 bdi_destroy(&psb->bdi);
1828 goto err_out_free_sb;
1829 }
1830
1818 sb->s_fs_info = psb; 1831 sb->s_fs_info = psb;
1819 sb->s_op = &pohmelfs_sb_ops; 1832 sb->s_op = &pohmelfs_sb_ops;
1820 sb->s_magic = POHMELFS_MAGIC_NUM; 1833 sb->s_magic = POHMELFS_MAGIC_NUM;
1821 sb->s_maxbytes = MAX_LFS_FILESIZE; 1834 sb->s_maxbytes = MAX_LFS_FILESIZE;
1822 sb->s_blocksize = PAGE_SIZE; 1835 sb->s_blocksize = PAGE_SIZE;
1836 sb->s_bdi = &psb->bdi;
1823 1837
1824 psb->sb = sb; 1838 psb->sb = sb;
1825 1839
@@ -1863,11 +1877,11 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
1863 1877
1864 err = pohmelfs_parse_options((char *) data, psb, 0); 1878 err = pohmelfs_parse_options((char *) data, psb, 0);
1865 if (err) 1879 if (err)
1866 goto err_out_free_sb; 1880 goto err_out_free_bdi;
1867 1881
1868 err = pohmelfs_copy_crypto(psb); 1882 err = pohmelfs_copy_crypto(psb);
1869 if (err) 1883 if (err)
1870 goto err_out_free_sb; 1884 goto err_out_free_bdi;
1871 1885
1872 err = pohmelfs_state_init(psb); 1886 err = pohmelfs_state_init(psb);
1873 if (err) 1887 if (err)
@@ -1916,6 +1930,8 @@ err_out_state_exit:
1916err_out_free_strings: 1930err_out_free_strings:
1917 kfree(psb->cipher_string); 1931 kfree(psb->cipher_string);
1918 kfree(psb->hash_string); 1932 kfree(psb->hash_string);
1933err_out_free_bdi:
1934 bdi_destroy(&psb->bdi);
1919err_out_free_sb: 1935err_out_free_sb:
1920 kfree(psb); 1936 kfree(psb);
1921err_out_exit: 1937err_out_exit:
diff --git a/drivers/staging/pohmelfs/netfs.h b/drivers/staging/pohmelfs/netfs.h
index 623a07d29dea..01cba006e07a 100644
--- a/drivers/staging/pohmelfs/netfs.h
+++ b/drivers/staging/pohmelfs/netfs.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/connector.h> 20#include <linux/connector.h>
21#include <linux/backing-dev.h>
21 22
22#define POHMELFS_CN_IDX 5 23#define POHMELFS_CN_IDX 5
23#define POHMELFS_CN_VAL 0 24#define POHMELFS_CN_VAL 0
@@ -624,6 +625,8 @@ struct pohmelfs_sb {
624 625
625 struct super_block *sb; 626 struct super_block *sb;
626 627
628 struct backing_dev_info bdi;
629
627 /* 630 /*
628 * Algorithm strings. 631 * Algorithm strings.
629 */ 632 */