aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-27 17:48:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-27 17:48:34 -0400
commit2c9e15a011c55ff96b2b8d2b126d1b9a96abba20 (patch)
tree6d9b27a07f88ad4509dcd86aa74a2cdecd0d5f4b /fs/reiserfs
parent805de022b100bcf796860fe88d7db4164066d1c3 (diff)
parentc16831b4cc9b0805adf8ca3001752a7ec10a17bf (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6: (27 commits) ext2: Zero our b_size in ext2_quota_read() trivial: fix typos/grammar errors in fs/Kconfig quota: Coding style fixes quota: Remove superfluous inlines quota: Remove uppercase aliases for quota functions. nfsd: Use lowercase names of quota functions jfs: Use lowercase names of quota functions udf: Use lowercase names of quota functions ufs: Use lowercase names of quota functions reiserfs: Use lowercase names of quota functions ext4: Use lowercase names of quota functions ext3: Use lowercase names of quota functions ext2: Use lowercase names of quota functions ramfs: Remove quota call vfs: Use lowercase names of quota functions quota: Remove dqbuf_t and other cleanups quota: Remove NODQUOT macro quota: Make global quota locks cacheline aligned quota: Move quota files into separate directory ext4: quota reservation for delayed allocation ...
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/bitmap.c14
-rw-r--r--fs/reiserfs/inode.c10
-rw-r--r--fs/reiserfs/namei.c6
-rw-r--r--fs/reiserfs/stree.c14
-rw-r--r--fs/reiserfs/super.c60
5 files changed, 26 insertions, 78 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 4646caa60455..f32d1425cc9f 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -430,7 +430,7 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
430 430
431 journal_mark_dirty(th, s, sbh); 431 journal_mark_dirty(th, s, sbh);
432 if (for_unformatted) 432 if (for_unformatted)
433 DQUOT_FREE_BLOCK_NODIRTY(inode, 1); 433 vfs_dq_free_block_nodirty(inode, 1);
434} 434}
435 435
436void reiserfs_free_block(struct reiserfs_transaction_handle *th, 436void reiserfs_free_block(struct reiserfs_transaction_handle *th,
@@ -1055,7 +1055,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1055 amount_needed, hint->inode->i_uid); 1055 amount_needed, hint->inode->i_uid);
1056#endif 1056#endif
1057 quota_ret = 1057 quota_ret =
1058 DQUOT_ALLOC_BLOCK_NODIRTY(hint->inode, amount_needed); 1058 vfs_dq_alloc_block_nodirty(hint->inode, amount_needed);
1059 if (quota_ret) /* Quota exceeded? */ 1059 if (quota_ret) /* Quota exceeded? */
1060 return QUOTA_EXCEEDED; 1060 return QUOTA_EXCEEDED;
1061 if (hint->preallocate && hint->prealloc_size) { 1061 if (hint->preallocate && hint->prealloc_size) {
@@ -1064,8 +1064,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1064 "reiserquota: allocating (prealloc) %d blocks id=%u", 1064 "reiserquota: allocating (prealloc) %d blocks id=%u",
1065 hint->prealloc_size, hint->inode->i_uid); 1065 hint->prealloc_size, hint->inode->i_uid);
1066#endif 1066#endif
1067 quota_ret = 1067 quota_ret = vfs_dq_prealloc_block_nodirty(hint->inode,
1068 DQUOT_PREALLOC_BLOCK_NODIRTY(hint->inode,
1069 hint->prealloc_size); 1068 hint->prealloc_size);
1070 if (quota_ret) 1069 if (quota_ret)
1071 hint->preallocate = hint->prealloc_size = 0; 1070 hint->preallocate = hint->prealloc_size = 0;
@@ -1098,7 +1097,10 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1098 nr_allocated, 1097 nr_allocated,
1099 hint->inode->i_uid); 1098 hint->inode->i_uid);
1100#endif 1099#endif
1101 DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + hint->prealloc_size - nr_allocated); /* Free not allocated blocks */ 1100 /* Free not allocated blocks */
1101 vfs_dq_free_block_nodirty(hint->inode,
1102 amount_needed + hint->prealloc_size -
1103 nr_allocated);
1102 } 1104 }
1103 while (nr_allocated--) 1105 while (nr_allocated--)
1104 reiserfs_free_block(hint->th, hint->inode, 1106 reiserfs_free_block(hint->th, hint->inode,
@@ -1129,7 +1131,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1129 REISERFS_I(hint->inode)->i_prealloc_count, 1131 REISERFS_I(hint->inode)->i_prealloc_count,
1130 hint->inode->i_uid); 1132 hint->inode->i_uid);
1131#endif 1133#endif
1132 DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + 1134 vfs_dq_free_block_nodirty(hint->inode, amount_needed +
1133 hint->prealloc_size - nr_allocated - 1135 hint->prealloc_size - nr_allocated -
1134 REISERFS_I(hint->inode)-> 1136 REISERFS_I(hint->inode)->
1135 i_prealloc_count); 1137 i_prealloc_count);
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 55fce92cdf18..823227a7662a 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -53,7 +53,7 @@ void reiserfs_delete_inode(struct inode *inode)
53 * after delete_object so that quota updates go into the same transaction as 53 * after delete_object so that quota updates go into the same transaction as
54 * stat data deletion */ 54 * stat data deletion */
55 if (!err) 55 if (!err)
56 DQUOT_FREE_INODE(inode); 56 vfs_dq_free_inode(inode);
57 57
58 if (journal_end(&th, inode->i_sb, jbegin_count)) 58 if (journal_end(&th, inode->i_sb, jbegin_count))
59 goto out; 59 goto out;
@@ -1763,7 +1763,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1763 1763
1764 BUG_ON(!th->t_trans_id); 1764 BUG_ON(!th->t_trans_id);
1765 1765
1766 if (DQUOT_ALLOC_INODE(inode)) { 1766 if (vfs_dq_alloc_inode(inode)) {
1767 err = -EDQUOT; 1767 err = -EDQUOT;
1768 goto out_end_trans; 1768 goto out_end_trans;
1769 } 1769 }
@@ -1947,12 +1947,12 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1947 INODE_PKEY(inode)->k_objectid = 0; 1947 INODE_PKEY(inode)->k_objectid = 0;
1948 1948
1949 /* Quota change must be inside a transaction for journaling */ 1949 /* Quota change must be inside a transaction for journaling */
1950 DQUOT_FREE_INODE(inode); 1950 vfs_dq_free_inode(inode);
1951 1951
1952 out_end_trans: 1952 out_end_trans:
1953 journal_end(th, th->t_super, th->t_blocks_allocated); 1953 journal_end(th, th->t_super, th->t_blocks_allocated);
1954 /* Drop can be outside and it needs more credits so it's better to have it outside */ 1954 /* Drop can be outside and it needs more credits so it's better to have it outside */
1955 DQUOT_DROP(inode); 1955 vfs_dq_drop(inode);
1956 inode->i_flags |= S_NOQUOTA; 1956 inode->i_flags |= S_NOQUOTA;
1957 make_bad_inode(inode); 1957 make_bad_inode(inode);
1958 1958
@@ -3119,7 +3119,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3119 if (error) 3119 if (error)
3120 goto out; 3120 goto out;
3121 error = 3121 error =
3122 DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; 3122 vfs_dq_transfer(inode, attr) ? -EDQUOT : 0;
3123 if (error) { 3123 if (error) {
3124 journal_end(&th, inode->i_sb, 3124 journal_end(&th, inode->i_sb,
3125 jbegin_count); 3125 jbegin_count);
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 738967f6c8ee..639d635d9d4b 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -555,7 +555,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
555*/ 555*/
556static int drop_new_inode(struct inode *inode) 556static int drop_new_inode(struct inode *inode)
557{ 557{
558 DQUOT_DROP(inode); 558 vfs_dq_drop(inode);
559 make_bad_inode(inode); 559 make_bad_inode(inode);
560 inode->i_flags |= S_NOQUOTA; 560 inode->i_flags |= S_NOQUOTA;
561 iput(inode); 561 iput(inode);
@@ -563,7 +563,7 @@ static int drop_new_inode(struct inode *inode)
563} 563}
564 564
565/* utility function that does setup for reiserfs_new_inode. 565/* utility function that does setup for reiserfs_new_inode.
566** DQUOT_INIT needs lots of credits so it's better to have it 566** vfs_dq_init needs lots of credits so it's better to have it
567** outside of a transaction, so we had to pull some bits of 567** outside of a transaction, so we had to pull some bits of
568** reiserfs_new_inode out into this func. 568** reiserfs_new_inode out into this func.
569*/ 569*/
@@ -586,7 +586,7 @@ static int new_inode_init(struct inode *inode, struct inode *dir, int mode)
586 } else { 586 } else {
587 inode->i_gid = current_fsgid(); 587 inode->i_gid = current_fsgid();
588 } 588 }
589 DQUOT_INIT(inode); 589 vfs_dq_init(inode);
590 return 0; 590 return 0;
591} 591}
592 592
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index abbc64dcc8d4..73aaa33f6735 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -1297,7 +1297,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
1297 "reiserquota delete_item(): freeing %u, id=%u type=%c", 1297 "reiserquota delete_item(): freeing %u, id=%u type=%c",
1298 quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih)); 1298 quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih));
1299#endif 1299#endif
1300 DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes); 1300 vfs_dq_free_space_nodirty(p_s_inode, quota_cut_bytes);
1301 1301
1302 /* Return deleted body length */ 1302 /* Return deleted body length */
1303 return n_ret_value; 1303 return n_ret_value;
@@ -1383,7 +1383,7 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
1383 quota_cut_bytes, inode->i_uid, 1383 quota_cut_bytes, inode->i_uid,
1384 key2type(key)); 1384 key2type(key));
1385#endif 1385#endif
1386 DQUOT_FREE_SPACE_NODIRTY(inode, 1386 vfs_dq_free_space_nodirty(inode,
1387 quota_cut_bytes); 1387 quota_cut_bytes);
1388 } 1388 }
1389 break; 1389 break;
@@ -1734,7 +1734,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1734 "reiserquota cut_from_item(): freeing %u id=%u type=%c", 1734 "reiserquota cut_from_item(): freeing %u id=%u type=%c",
1735 quota_cut_bytes, p_s_inode->i_uid, '?'); 1735 quota_cut_bytes, p_s_inode->i_uid, '?');
1736#endif 1736#endif
1737 DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes); 1737 vfs_dq_free_space_nodirty(p_s_inode, quota_cut_bytes);
1738 return n_ret_value; 1738 return n_ret_value;
1739} 1739}
1740 1740
@@ -1971,7 +1971,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
1971 key2type(&(p_s_key->on_disk_key))); 1971 key2type(&(p_s_key->on_disk_key)));
1972#endif 1972#endif
1973 1973
1974 if (DQUOT_ALLOC_SPACE_NODIRTY(inode, n_pasted_size)) { 1974 if (vfs_dq_alloc_space_nodirty(inode, n_pasted_size)) {
1975 pathrelse(p_s_search_path); 1975 pathrelse(p_s_search_path);
1976 return -EDQUOT; 1976 return -EDQUOT;
1977 } 1977 }
@@ -2027,7 +2027,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
2027 n_pasted_size, inode->i_uid, 2027 n_pasted_size, inode->i_uid,
2028 key2type(&(p_s_key->on_disk_key))); 2028 key2type(&(p_s_key->on_disk_key)));
2029#endif 2029#endif
2030 DQUOT_FREE_SPACE_NODIRTY(inode, n_pasted_size); 2030 vfs_dq_free_space_nodirty(inode, n_pasted_size);
2031 return retval; 2031 return retval;
2032} 2032}
2033 2033
@@ -2060,7 +2060,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath
2060#endif 2060#endif
2061 /* We can't dirty inode here. It would be immediately written but 2061 /* We can't dirty inode here. It would be immediately written but
2062 * appropriate stat item isn't inserted yet... */ 2062 * appropriate stat item isn't inserted yet... */
2063 if (DQUOT_ALLOC_SPACE_NODIRTY(inode, quota_bytes)) { 2063 if (vfs_dq_alloc_space_nodirty(inode, quota_bytes)) {
2064 pathrelse(p_s_path); 2064 pathrelse(p_s_path);
2065 return -EDQUOT; 2065 return -EDQUOT;
2066 } 2066 }
@@ -2112,6 +2112,6 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath
2112 quota_bytes, inode->i_uid, head2type(p_s_ih)); 2112 quota_bytes, inode->i_uid, head2type(p_s_ih));
2113#endif 2113#endif
2114 if (inode) 2114 if (inode)
2115 DQUOT_FREE_SPACE_NODIRTY(inode, quota_bytes); 2115 vfs_dq_free_space_nodirty(inode, quota_bytes);
2116 return retval; 2116 return retval;
2117} 2117}
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index f3c820b75829..5dbafb739401 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -250,7 +250,7 @@ static int finish_unfinished(struct super_block *s)
250 retval = remove_save_link_only(s, &save_link_key, 0); 250 retval = remove_save_link_only(s, &save_link_key, 0);
251 continue; 251 continue;
252 } 252 }
253 DQUOT_INIT(inode); 253 vfs_dq_init(inode);
254 254
255 if (truncate && S_ISDIR(inode->i_mode)) { 255 if (truncate && S_ISDIR(inode->i_mode)) {
256 /* We got a truncate request for a dir which is impossible. 256 /* We got a truncate request for a dir which is impossible.
@@ -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
632static int reiserfs_dquot_initialize(struct inode *, int);
633static int reiserfs_dquot_drop(struct inode *);
634static int reiserfs_write_dquot(struct dquot *); 632static int reiserfs_write_dquot(struct dquot *);
635static int reiserfs_acquire_dquot(struct dquot *); 633static int reiserfs_acquire_dquot(struct dquot *);
636static int reiserfs_release_dquot(struct dquot *); 634static int reiserfs_release_dquot(struct dquot *);
@@ -639,8 +637,8 @@ static int reiserfs_write_info(struct super_block *, int);
639static int reiserfs_quota_on(struct super_block *, int, int, char *, int); 637static int reiserfs_quota_on(struct super_block *, int, int, char *, int);
640 638
641static struct dquot_operations reiserfs_quota_operations = { 639static 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
1899static 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
1922static 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
1951static int reiserfs_write_dquot(struct dquot *dquot) 1897static int reiserfs_write_dquot(struct dquot *dquot)
1952{ 1898{
1953 struct reiserfs_transaction_handle th; 1899 struct reiserfs_transaction_handle th;