diff options
-rw-r--r-- | fs/reiserfs/super.c | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index f3c820b75829..317c0352163c 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -629,8 +629,6 @@ static const struct super_operations reiserfs_sops = { | |||
629 | #ifdef CONFIG_QUOTA | 629 | #ifdef CONFIG_QUOTA |
630 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") | 630 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") |
631 | 631 | ||
632 | static int reiserfs_dquot_initialize(struct inode *, int); | ||
633 | static int reiserfs_dquot_drop(struct inode *); | ||
634 | static int reiserfs_write_dquot(struct dquot *); | 632 | static int reiserfs_write_dquot(struct dquot *); |
635 | static int reiserfs_acquire_dquot(struct dquot *); | 633 | static int reiserfs_acquire_dquot(struct dquot *); |
636 | static int reiserfs_release_dquot(struct dquot *); | 634 | static int reiserfs_release_dquot(struct dquot *); |
@@ -639,8 +637,8 @@ static int reiserfs_write_info(struct super_block *, int); | |||
639 | static int reiserfs_quota_on(struct super_block *, int, int, char *, int); | 637 | static int reiserfs_quota_on(struct super_block *, int, int, char *, int); |
640 | 638 | ||
641 | static struct dquot_operations reiserfs_quota_operations = { | 639 | static struct dquot_operations reiserfs_quota_operations = { |
642 | .initialize = reiserfs_dquot_initialize, | 640 | .initialize = dquot_initialize, |
643 | .drop = reiserfs_dquot_drop, | 641 | .drop = dquot_drop, |
644 | .alloc_space = dquot_alloc_space, | 642 | .alloc_space = dquot_alloc_space, |
645 | .alloc_inode = dquot_alloc_inode, | 643 | .alloc_inode = dquot_alloc_inode, |
646 | .free_space = dquot_free_space, | 644 | .free_space = dquot_free_space, |
@@ -1896,58 +1894,6 @@ static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
1896 | } | 1894 | } |
1897 | 1895 | ||
1898 | #ifdef CONFIG_QUOTA | 1896 | #ifdef CONFIG_QUOTA |
1899 | static int reiserfs_dquot_initialize(struct inode *inode, int type) | ||
1900 | { | ||
1901 | struct reiserfs_transaction_handle th; | ||
1902 | int ret, err; | ||
1903 | |||
1904 | /* We may create quota structure so we need to reserve enough blocks */ | ||
1905 | reiserfs_write_lock(inode->i_sb); | ||
1906 | ret = | ||
1907 | journal_begin(&th, inode->i_sb, | ||
1908 | 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb)); | ||
1909 | if (ret) | ||
1910 | goto out; | ||
1911 | ret = dquot_initialize(inode, type); | ||
1912 | err = | ||
1913 | journal_end(&th, inode->i_sb, | ||
1914 | 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb)); | ||
1915 | if (!ret && err) | ||
1916 | ret = err; | ||
1917 | out: | ||
1918 | reiserfs_write_unlock(inode->i_sb); | ||
1919 | return ret; | ||
1920 | } | ||
1921 | |||
1922 | static int reiserfs_dquot_drop(struct inode *inode) | ||
1923 | { | ||
1924 | struct reiserfs_transaction_handle th; | ||
1925 | int ret, err; | ||
1926 | |||
1927 | /* We may delete quota structure so we need to reserve enough blocks */ | ||
1928 | reiserfs_write_lock(inode->i_sb); | ||
1929 | ret = | ||
1930 | journal_begin(&th, inode->i_sb, | ||
1931 | 2 * REISERFS_QUOTA_DEL_BLOCKS(inode->i_sb)); | ||
1932 | if (ret) { | ||
1933 | /* | ||
1934 | * We call dquot_drop() anyway to at least release references | ||
1935 | * to quota structures so that umount does not hang. | ||
1936 | */ | ||
1937 | dquot_drop(inode); | ||
1938 | goto out; | ||
1939 | } | ||
1940 | ret = dquot_drop(inode); | ||
1941 | err = | ||
1942 | journal_end(&th, inode->i_sb, | ||
1943 | 2 * REISERFS_QUOTA_DEL_BLOCKS(inode->i_sb)); | ||
1944 | if (!ret && err) | ||
1945 | ret = err; | ||
1946 | out: | ||
1947 | reiserfs_write_unlock(inode->i_sb); | ||
1948 | return ret; | ||
1949 | } | ||
1950 | |||
1951 | static int reiserfs_write_dquot(struct dquot *dquot) | 1897 | static int reiserfs_write_dquot(struct dquot *dquot) |
1952 | { | 1898 | { |
1953 | struct reiserfs_transaction_handle th; | 1899 | struct reiserfs_transaction_handle th; |