aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/Makefile2
-rw-r--r--fs/reiserfs/bitmap.c1
-rw-r--r--fs/reiserfs/dir.c1
-rw-r--r--fs/reiserfs/do_balan.c1
-rw-r--r--fs/reiserfs/file.c18
-rw-r--r--fs/reiserfs/fix_node.c1
-rw-r--r--fs/reiserfs/ibalance.c1
-rw-r--r--fs/reiserfs/inode.c52
-rw-r--r--fs/reiserfs/ioctl.c2
-rw-r--r--fs/reiserfs/journal.c61
-rw-r--r--fs/reiserfs/lbalance.c1
-rw-r--r--fs/reiserfs/namei.c1
-rw-r--r--fs/reiserfs/objectid.c1
-rw-r--r--fs/reiserfs/prints.c1
-rw-r--r--fs/reiserfs/procfs.c26
-rw-r--r--fs/reiserfs/stree.c1
-rw-r--r--fs/reiserfs/super.c34
-rw-r--r--fs/reiserfs/tail_conversion.c1
-rw-r--r--fs/reiserfs/xattr.c2
19 files changed, 115 insertions, 93 deletions
diff --git a/fs/reiserfs/Makefile b/fs/reiserfs/Makefile
index 3a59309f3ca9..0eb7ac080484 100644
--- a/fs/reiserfs/Makefile
+++ b/fs/reiserfs/Makefile
@@ -28,7 +28,7 @@ endif
28# will work around it. If any other architecture displays this behavior, 28# will work around it. If any other architecture displays this behavior,
29# add it here. 29# add it here.
30ifeq ($(CONFIG_PPC32),y) 30ifeq ($(CONFIG_PPC32),y)
31EXTRA_CFLAGS := -O1 31EXTRA_CFLAGS := $(call cc-ifversion, -lt, 0400, -O1)
32endif 32endif
33 33
34TAGS: 34TAGS:
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 909f71e9a30f..4a7dbdee1b6d 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -3,7 +3,6 @@
3 */ 3 */
4/* Reiserfs block (de)allocator, bitmap-based. */ 4/* Reiserfs block (de)allocator, bitmap-based. */
5 5
6#include <linux/config.h>
7#include <linux/time.h> 6#include <linux/time.h>
8#include <linux/reiserfs_fs.h> 7#include <linux/reiserfs_fs.h>
9#include <linux/errno.h> 8#include <linux/errno.h>
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index 973c819f8033..9aabcc0ccd2d 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -2,7 +2,6 @@
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/string.h> 5#include <linux/string.h>
7#include <linux/errno.h> 6#include <linux/errno.h>
8#include <linux/fs.h> 7#include <linux/fs.h>
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index b2264ba3cc56..fba304e64de8 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -15,7 +15,6 @@
15 ** 15 **
16 **/ 16 **/
17 17
18#include <linux/config.h>
19#include <asm/uaccess.h> 18#include <asm/uaccess.h>
20#include <linux/time.h> 19#include <linux/time.h>
21#include <linux/reiserfs_fs.h> 20#include <linux/reiserfs_fs.h>
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index cf6e1cf40351..1cfbe857ba27 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
48 return 0; 48 return 0;
49 } 49 }
50 50
51 reiserfs_write_lock(inode->i_sb);
52 mutex_lock(&inode->i_mutex); 51 mutex_lock(&inode->i_mutex);
52 reiserfs_write_lock(inode->i_sb);
53 /* freeing preallocation only involves relogging blocks that 53 /* freeing preallocation only involves relogging blocks that
54 * are already in the current transaction. preallocation gets 54 * are already in the current transaction. preallocation gets
55 * freed at the end of each transaction, so it is impossible for 55 * freed at the end of each transaction, so it is impossible for
@@ -130,7 +130,7 @@ static int reiserfs_sync_file(struct file *p_s_filp,
130 reiserfs_write_lock(p_s_inode->i_sb); 130 reiserfs_write_lock(p_s_inode->i_sb);
131 barrier_done = reiserfs_commit_for_inode(p_s_inode); 131 barrier_done = reiserfs_commit_for_inode(p_s_inode);
132 reiserfs_write_unlock(p_s_inode->i_sb); 132 reiserfs_write_unlock(p_s_inode->i_sb);
133 if (barrier_done != 1) 133 if (barrier_done != 1 && reiserfs_barrier_flush(p_s_inode->i_sb))
134 blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL); 134 blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL);
135 if (barrier_done < 0) 135 if (barrier_done < 0)
136 return barrier_done; 136 return barrier_done;
@@ -860,8 +860,12 @@ static int reiserfs_submit_file_region_for_write(struct reiserfs_transaction_han
860 // this sets the proper flags for O_SYNC to trigger a commit 860 // this sets the proper flags for O_SYNC to trigger a commit
861 mark_inode_dirty(inode); 861 mark_inode_dirty(inode);
862 reiserfs_write_unlock(inode->i_sb); 862 reiserfs_write_unlock(inode->i_sb);
863 } else 863 } else {
864 reiserfs_write_lock(inode->i_sb);
865 reiserfs_update_inode_transaction(inode);
864 mark_inode_dirty(inode); 866 mark_inode_dirty(inode);
867 reiserfs_write_unlock(inode->i_sb);
868 }
865 869
866 sd_update = 1; 870 sd_update = 1;
867 } 871 }
@@ -1560,12 +1564,6 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
1560 return res; 1564 return res;
1561} 1565}
1562 1566
1563static ssize_t reiserfs_aio_write(struct kiocb *iocb, const char __user * buf,
1564 size_t count, loff_t pos)
1565{
1566 return generic_file_aio_write(iocb, buf, count, pos);
1567}
1568
1569const struct file_operations reiserfs_file_operations = { 1567const struct file_operations reiserfs_file_operations = {
1570 .read = generic_file_read, 1568 .read = generic_file_read,
1571 .write = reiserfs_file_write, 1569 .write = reiserfs_file_write,
@@ -1575,7 +1573,7 @@ const struct file_operations reiserfs_file_operations = {
1575 .fsync = reiserfs_sync_file, 1573 .fsync = reiserfs_sync_file,
1576 .sendfile = generic_file_sendfile, 1574 .sendfile = generic_file_sendfile,
1577 .aio_read = generic_file_aio_read, 1575 .aio_read = generic_file_aio_read,
1578 .aio_write = reiserfs_aio_write, 1576 .aio_write = generic_file_aio_write,
1579 .splice_read = generic_file_splice_read, 1577 .splice_read = generic_file_splice_read,
1580 .splice_write = generic_file_splice_write, 1578 .splice_write = generic_file_splice_write,
1581}; 1579};
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 5600d3d60cf7..6d0e554daa9d 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -34,7 +34,6 @@
34 ** 34 **
35 **/ 35 **/
36 36
37#include <linux/config.h>
38#include <linux/time.h> 37#include <linux/time.h>
39#include <linux/string.h> 38#include <linux/string.h>
40#include <linux/reiserfs_fs.h> 39#include <linux/reiserfs_fs.h>
diff --git a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c
index 6c5a726fd34b..de391a82b999 100644
--- a/fs/reiserfs/ibalance.c
+++ b/fs/reiserfs/ibalance.c
@@ -2,7 +2,6 @@
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <asm/uaccess.h> 5#include <asm/uaccess.h>
7#include <linux/string.h> 6#include <linux/string.h>
8#include <linux/time.h> 7#include <linux/time.h>
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 9857e50f85e7..7e5a2f5ebeb0 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2,7 +2,6 @@
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/time.h> 5#include <linux/time.h>
7#include <linux/fs.h> 6#include <linux/fs.h>
8#include <linux/reiserfs_fs.h> 7#include <linux/reiserfs_fs.h>
@@ -18,8 +17,6 @@
18#include <linux/writeback.h> 17#include <linux/writeback.h>
19#include <linux/quotaops.h> 18#include <linux/quotaops.h>
20 19
21extern int reiserfs_default_io_size; /* default io size devuned in super.c */
22
23static int reiserfs_commit_write(struct file *f, struct page *page, 20static int reiserfs_commit_write(struct file *f, struct page *page,
24 unsigned from, unsigned to); 21 unsigned from, unsigned to);
25static int reiserfs_prepare_write(struct file *f, struct page *page, 22static int reiserfs_prepare_write(struct file *f, struct page *page,
@@ -40,14 +37,10 @@ void reiserfs_delete_inode(struct inode *inode)
40 37
41 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */ 38 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
42 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */ 39 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */
43 mutex_lock(&inode->i_mutex);
44
45 reiserfs_delete_xattrs(inode); 40 reiserfs_delete_xattrs(inode);
46 41
47 if (journal_begin(&th, inode->i_sb, jbegin_count)) { 42 if (journal_begin(&th, inode->i_sb, jbegin_count))
48 mutex_unlock(&inode->i_mutex);
49 goto out; 43 goto out;
50 }
51 reiserfs_update_inode_transaction(inode); 44 reiserfs_update_inode_transaction(inode);
52 45
53 err = reiserfs_delete_object(&th, inode); 46 err = reiserfs_delete_object(&th, inode);
@@ -58,12 +51,8 @@ void reiserfs_delete_inode(struct inode *inode)
58 if (!err) 51 if (!err)
59 DQUOT_FREE_INODE(inode); 52 DQUOT_FREE_INODE(inode);
60 53
61 if (journal_end(&th, inode->i_sb, jbegin_count)) { 54 if (journal_end(&th, inode->i_sb, jbegin_count))
62 mutex_unlock(&inode->i_mutex);
63 goto out; 55 goto out;
64 }
65
66 mutex_unlock(&inode->i_mutex);
67 56
68 /* check return value from reiserfs_delete_object after 57 /* check return value from reiserfs_delete_object after
69 * ending the transaction 58 * ending the transaction
@@ -1131,7 +1120,6 @@ static void init_inode(struct inode *inode, struct path *path)
1131 ih = PATH_PITEM_HEAD(path); 1120 ih = PATH_PITEM_HEAD(path);
1132 1121
1133 copy_key(INODE_PKEY(inode), &(ih->ih_key)); 1122 copy_key(INODE_PKEY(inode), &(ih->ih_key));
1134 inode->i_blksize = reiserfs_default_io_size;
1135 1123
1136 INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list)); 1124 INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list));
1137 REISERFS_I(inode)->i_flags = 0; 1125 REISERFS_I(inode)->i_flags = 0;
@@ -1139,9 +1127,9 @@ static void init_inode(struct inode *inode, struct path *path)
1139 REISERFS_I(inode)->i_prealloc_count = 0; 1127 REISERFS_I(inode)->i_prealloc_count = 0;
1140 REISERFS_I(inode)->i_trans_id = 0; 1128 REISERFS_I(inode)->i_trans_id = 0;
1141 REISERFS_I(inode)->i_jl = NULL; 1129 REISERFS_I(inode)->i_jl = NULL;
1142 REISERFS_I(inode)->i_acl_access = NULL; 1130 reiserfs_init_acl_access(inode);
1143 REISERFS_I(inode)->i_acl_default = NULL; 1131 reiserfs_init_acl_default(inode);
1144 init_rwsem(&REISERFS_I(inode)->xattr_sem); 1132 reiserfs_init_xattr_rwsem(inode);
1145 1133
1146 if (stat_data_v1(ih)) { 1134 if (stat_data_v1(ih)) {
1147 struct stat_data_v1 *sd = 1135 struct stat_data_v1 *sd =
@@ -1846,9 +1834,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1846 REISERFS_I(inode)->i_attrs = 1834 REISERFS_I(inode)->i_attrs =
1847 REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK; 1835 REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK;
1848 sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode); 1836 sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode);
1849 REISERFS_I(inode)->i_acl_access = NULL; 1837 reiserfs_init_acl_access(inode);
1850 REISERFS_I(inode)->i_acl_default = NULL; 1838 reiserfs_init_acl_default(inode);
1851 init_rwsem(&REISERFS_I(inode)->xattr_sem); 1839 reiserfs_init_xattr_rwsem(inode);
1852 1840
1853 if (old_format_only(sb)) 1841 if (old_format_only(sb))
1854 make_le_item_head(&ih, NULL, KEY_FORMAT_3_5, SD_OFFSET, 1842 make_le_item_head(&ih, NULL, KEY_FORMAT_3_5, SD_OFFSET,
@@ -1886,7 +1874,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1886 } 1874 }
1887 // these do not go to on-disk stat data 1875 // these do not go to on-disk stat data
1888 inode->i_ino = le32_to_cpu(ih.ih_key.k_objectid); 1876 inode->i_ino = le32_to_cpu(ih.ih_key.k_objectid);
1889 inode->i_blksize = reiserfs_default_io_size;
1890 1877
1891 // store in in-core inode the key of stat data and version all 1878 // store in in-core inode the key of stat data and version all
1892 // object items will have (directory items will have old offset 1879 // object items will have (directory items will have old offset
@@ -1987,11 +1974,13 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1987 * iput doesn't deadlock in reiserfs_delete_xattrs. The locking 1974 * iput doesn't deadlock in reiserfs_delete_xattrs. The locking
1988 * code really needs to be reworked, but this will take care of it 1975 * code really needs to be reworked, but this will take care of it
1989 * for now. -jeffm */ 1976 * for now. -jeffm */
1977#ifdef CONFIG_REISERFS_FS_POSIX_ACL
1990 if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) { 1978 if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) {
1991 reiserfs_write_unlock_xattrs(dir->i_sb); 1979 reiserfs_write_unlock_xattrs(dir->i_sb);
1992 iput(inode); 1980 iput(inode);
1993 reiserfs_write_lock_xattrs(dir->i_sb); 1981 reiserfs_write_lock_xattrs(dir->i_sb);
1994 } else 1982 } else
1983#endif
1995 iput(inode); 1984 iput(inode);
1996 return err; 1985 return err;
1997} 1986}
@@ -2349,6 +2338,7 @@ static int reiserfs_write_full_page(struct page *page,
2349 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; 2338 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;
2350 int error = 0; 2339 int error = 0;
2351 unsigned long block; 2340 unsigned long block;
2341 sector_t last_block;
2352 struct buffer_head *head, *bh; 2342 struct buffer_head *head, *bh;
2353 int partial = 0; 2343 int partial = 0;
2354 int nr = 0; 2344 int nr = 0;
@@ -2396,10 +2386,19 @@ static int reiserfs_write_full_page(struct page *page,
2396 } 2386 }
2397 bh = head; 2387 bh = head;
2398 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits); 2388 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits);
2389 last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;
2399 /* first map all the buffers, logging any direct items we find */ 2390 /* first map all the buffers, logging any direct items we find */
2400 do { 2391 do {
2401 if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) || 2392 if (block > last_block) {
2402 (buffer_mapped(bh) 2393 /*
2394 * This can happen when the block size is less than
2395 * the page size. The corresponding bytes in the page
2396 * were zero filled above
2397 */
2398 clear_buffer_dirty(bh);
2399 set_buffer_uptodate(bh);
2400 } else if ((checked || buffer_dirty(bh)) &&
2401 (!buffer_mapped(bh) || (buffer_mapped(bh)
2403 && bh->b_blocknr == 2402 && bh->b_blocknr ==
2404 0))) { 2403 0))) {
2405 /* not mapped yet, or it points to a direct item, search 2404 /* not mapped yet, or it points to a direct item, search
@@ -2933,6 +2932,11 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
2933 } 2932 }
2934 if (error) 2933 if (error)
2935 goto out; 2934 goto out;
2935 /*
2936 * file size is changed, ctime and mtime are
2937 * to be updated
2938 */
2939 attr->ia_valid |= (ATTR_MTIME | ATTR_CTIME);
2936 } 2940 }
2937 } 2941 }
2938 2942
@@ -2996,7 +3000,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
2996 return error; 3000 return error;
2997} 3001}
2998 3002
2999struct address_space_operations reiserfs_address_space_operations = { 3003const struct address_space_operations reiserfs_address_space_operations = {
3000 .writepage = reiserfs_writepage, 3004 .writepage = reiserfs_writepage,
3001 .readpage = reiserfs_readpage, 3005 .readpage = reiserfs_readpage,
3002 .readpages = reiserfs_readpages, 3006 .readpages = reiserfs_readpages,
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 745c88100895..a986b5e1e288 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) { 116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
117 return 0; 117 return 0;
118 } 118 }
119 reiserfs_write_lock(inode->i_sb);
120 119
121 /* we need to make sure nobody is changing the file size beneath 120 /* we need to make sure nobody is changing the file size beneath
122 ** us 121 ** us
123 */ 122 */
124 mutex_lock(&inode->i_mutex); 123 mutex_lock(&inode->i_mutex);
124 reiserfs_write_lock(inode->i_sb);
125 125
126 write_from = inode->i_size & (blocksize - 1); 126 write_from = inode->i_size & (blocksize - 1);
127 /* if we are on a block boundary, we are already unpacked. */ 127 /* if we are on a block boundary, we are already unpacked. */
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 1b73529b8099..e6b5ccf23f15 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -34,7 +34,6 @@
34** from within kupdate, it will ignore the immediate flag 34** from within kupdate, it will ignore the immediate flag
35*/ 35*/
36 36
37#include <linux/config.h>
38#include <asm/uaccess.h> 37#include <asm/uaccess.h>
39#include <asm/system.h> 38#include <asm/system.h>
40 39
@@ -834,8 +833,7 @@ static int write_ordered_buffers(spinlock_t * lock,
834 get_bh(bh); 833 get_bh(bh);
835 if (test_set_buffer_locked(bh)) { 834 if (test_set_buffer_locked(bh)) {
836 if (!buffer_dirty(bh)) { 835 if (!buffer_dirty(bh)) {
837 list_del_init(&jh->list); 836 list_move(&jh->list, &tmp);
838 list_add(&jh->list, &tmp);
839 goto loop_next; 837 goto loop_next;
840 } 838 }
841 spin_unlock(lock); 839 spin_unlock(lock);
@@ -855,8 +853,7 @@ static int write_ordered_buffers(spinlock_t * lock,
855 ret = -EIO; 853 ret = -EIO;
856 } 854 }
857 if (buffer_dirty(bh)) { 855 if (buffer_dirty(bh)) {
858 list_del_init(&jh->list); 856 list_move(&jh->list, &tmp);
859 list_add(&jh->list, &tmp);
860 add_to_chunk(&chunk, bh, lock, write_ordered_chunk); 857 add_to_chunk(&chunk, bh, lock, write_ordered_chunk);
861 } else { 858 } else {
862 reiserfs_free_jh(bh); 859 reiserfs_free_jh(bh);
@@ -1189,6 +1186,21 @@ static struct reiserfs_journal_list *find_newer_jl_for_cn(struct
1189 return NULL; 1186 return NULL;
1190} 1187}
1191 1188
1189static int newer_jl_done(struct reiserfs_journal_cnode *cn)
1190{
1191 struct super_block *sb = cn->sb;
1192 b_blocknr_t blocknr = cn->blocknr;
1193
1194 cn = cn->hprev;
1195 while (cn) {
1196 if (cn->sb == sb && cn->blocknr == blocknr && cn->jlist &&
1197 atomic_read(&cn->jlist->j_commit_left) != 0)
1198 return 0;
1199 cn = cn->hprev;
1200 }
1201 return 1;
1202}
1203
1192static void remove_journal_hash(struct super_block *, 1204static void remove_journal_hash(struct super_block *,
1193 struct reiserfs_journal_cnode **, 1205 struct reiserfs_journal_cnode **,
1194 struct reiserfs_journal_list *, unsigned long, 1206 struct reiserfs_journal_list *, unsigned long,
@@ -1607,6 +1619,31 @@ static int flush_journal_list(struct super_block *s,
1607 return err; 1619 return err;
1608} 1620}
1609 1621
1622static int test_transaction(struct super_block *s,
1623 struct reiserfs_journal_list *jl)
1624{
1625 struct reiserfs_journal_cnode *cn;
1626
1627 if (jl->j_len == 0 || atomic_read(&jl->j_nonzerolen) == 0)
1628 return 1;
1629
1630 cn = jl->j_realblock;
1631 while (cn) {
1632 /* if the blocknr == 0, this has been cleared from the hash,
1633 ** skip it
1634 */
1635 if (cn->blocknr == 0) {
1636 goto next;
1637 }
1638 if (cn->bh && !newer_jl_done(cn))
1639 return 0;
1640 next:
1641 cn = cn->next;
1642 cond_resched();
1643 }
1644 return 0;
1645}
1646
1610static int write_one_transaction(struct super_block *s, 1647static int write_one_transaction(struct super_block *s,
1611 struct reiserfs_journal_list *jl, 1648 struct reiserfs_journal_list *jl,
1612 struct buffer_chunk *chunk) 1649 struct buffer_chunk *chunk)
@@ -3436,16 +3473,6 @@ static void flush_async_commits(void *p)
3436 flush_commit_list(p_s_sb, jl, 1); 3473 flush_commit_list(p_s_sb, jl, 1);
3437 } 3474 }
3438 unlock_kernel(); 3475 unlock_kernel();
3439 /*
3440 * this is a little racey, but there's no harm in missing
3441 * the filemap_fdata_write
3442 */
3443 if (!atomic_read(&journal->j_async_throttle)
3444 && !reiserfs_is_journal_aborted(journal)) {
3445 atomic_inc(&journal->j_async_throttle);
3446 filemap_fdatawrite(p_s_sb->s_bdev->bd_inode->i_mapping);
3447 atomic_dec(&journal->j_async_throttle);
3448 }
3449} 3476}
3450 3477
3451/* 3478/*
@@ -3847,7 +3874,9 @@ static void flush_old_journal_lists(struct super_block *s)
3847 entry = journal->j_journal_list.next; 3874 entry = journal->j_journal_list.next;
3848 jl = JOURNAL_LIST_ENTRY(entry); 3875 jl = JOURNAL_LIST_ENTRY(entry);
3849 /* this check should always be run, to send old lists to disk */ 3876 /* this check should always be run, to send old lists to disk */
3850 if (jl->j_timestamp < (now - (JOURNAL_MAX_TRANS_AGE * 4))) { 3877 if (jl->j_timestamp < (now - (JOURNAL_MAX_TRANS_AGE * 4)) &&
3878 atomic_read(&jl->j_commit_left) == 0 &&
3879 test_transaction(s, jl)) {
3851 flush_used_journal_lists(s, jl); 3880 flush_used_journal_lists(s, jl);
3852 } else { 3881 } else {
3853 break; 3882 break;
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 2533c1f64aba..281f8061ac58 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -2,7 +2,6 @@
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <asm/uaccess.h> 5#include <asm/uaccess.h>
7#include <linux/string.h> 6#include <linux/string.h>
8#include <linux/time.h> 7#include <linux/time.h>
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 284f7852de8b..c61710e49c62 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -11,7 +11,6 @@
11 * NO WARRANTY 11 * NO WARRANTY
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/time.h> 14#include <linux/time.h>
16#include <linux/bitops.h> 15#include <linux/bitops.h>
17#include <linux/reiserfs_fs.h> 16#include <linux/reiserfs_fs.h>
diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c
index f62590aa9c95..65feba4deb69 100644
--- a/fs/reiserfs/objectid.c
+++ b/fs/reiserfs/objectid.c
@@ -2,7 +2,6 @@
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/string.h> 5#include <linux/string.h>
7#include <linux/random.h> 6#include <linux/random.h>
8#include <linux/time.h> 7#include <linux/time.h>
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 27bd3a1df2ad..bc808a91eeaa 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -2,7 +2,6 @@
2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/time.h> 5#include <linux/time.h>
7#include <linux/fs.h> 6#include <linux/fs.h>
8#include <linux/reiserfs_fs.h> 7#include <linux/reiserfs_fs.h>
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index 731688e1cfe3..c533ec1bcaec 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -10,7 +10,6 @@
10 10
11/* $Id: procfs.c,v 1.1.8.2 2001/07/15 17:08:42 god Exp $ */ 11/* $Id: procfs.c,v 1.1.8.2 2001/07/15 17:08:42 god Exp $ */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/time.h> 14#include <linux/time.h>
16#include <linux/seq_file.h> 15#include <linux/seq_file.h>
@@ -493,9 +492,17 @@ static void add_file(struct super_block *sb, char *name,
493 492
494int reiserfs_proc_info_init(struct super_block *sb) 493int reiserfs_proc_info_init(struct super_block *sb)
495{ 494{
495 char b[BDEVNAME_SIZE];
496 char *s;
497
498 /* Some block devices use /'s */
499 strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
500 s = strchr(b, '/');
501 if (s)
502 *s = '!';
503
496 spin_lock_init(&__PINFO(sb).lock); 504 spin_lock_init(&__PINFO(sb).lock);
497 REISERFS_SB(sb)->procdir = 505 REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root);
498 proc_mkdir(reiserfs_bdevname(sb), proc_info_root);
499 if (REISERFS_SB(sb)->procdir) { 506 if (REISERFS_SB(sb)->procdir) {
500 REISERFS_SB(sb)->procdir->owner = THIS_MODULE; 507 REISERFS_SB(sb)->procdir->owner = THIS_MODULE;
501 REISERFS_SB(sb)->procdir->data = sb; 508 REISERFS_SB(sb)->procdir->data = sb;
@@ -509,13 +516,22 @@ int reiserfs_proc_info_init(struct super_block *sb)
509 return 0; 516 return 0;
510 } 517 }
511 reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", 518 reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
512 proc_info_root_name, reiserfs_bdevname(sb)); 519 proc_info_root_name, b);
513 return 1; 520 return 1;
514} 521}
515 522
516int reiserfs_proc_info_done(struct super_block *sb) 523int reiserfs_proc_info_done(struct super_block *sb)
517{ 524{
518 struct proc_dir_entry *de = REISERFS_SB(sb)->procdir; 525 struct proc_dir_entry *de = REISERFS_SB(sb)->procdir;
526 char b[BDEVNAME_SIZE];
527 char *s;
528
529 /* Some block devices use /'s */
530 strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
531 s = strchr(b, '/');
532 if (s)
533 *s = '!';
534
519 if (de) { 535 if (de) {
520 remove_proc_entry("journal", de); 536 remove_proc_entry("journal", de);
521 remove_proc_entry("oidmap", de); 537 remove_proc_entry("oidmap", de);
@@ -529,7 +545,7 @@ int reiserfs_proc_info_done(struct super_block *sb)
529 __PINFO(sb).exiting = 1; 545 __PINFO(sb).exiting = 1;
530 spin_unlock(&__PINFO(sb).lock); 546 spin_unlock(&__PINFO(sb).lock);
531 if (proc_info_root) { 547 if (proc_info_root) {
532 remove_proc_entry(reiserfs_bdevname(sb), proc_info_root); 548 remove_proc_entry(b, proc_info_root);
533 REISERFS_SB(sb)->procdir = NULL; 549 REISERFS_SB(sb)->procdir = NULL;
534 } 550 }
535 return 0; 551 return 0;
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index d2b25e1ba6e9..8b9b13127136 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -49,7 +49,6 @@
49 * reiserfs_insert_item 49 * reiserfs_insert_item
50 */ 50 */
51 51
52#include <linux/config.h>
53#include <linux/time.h> 52#include <linux/time.h>
54#include <linux/string.h> 53#include <linux/string.h>
55#include <linux/pagemap.h> 54#include <linux/pagemap.h>
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 00f1321e9209..80fc3b32802f 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -11,7 +11,6 @@
11 * NO WARRANTY 11 * NO WARRANTY
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
17#include <linux/time.h> 16#include <linux/time.h>
@@ -511,8 +510,10 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
511 SLAB_CTOR_CONSTRUCTOR) { 510 SLAB_CTOR_CONSTRUCTOR) {
512 INIT_LIST_HEAD(&ei->i_prealloc_list); 511 INIT_LIST_HEAD(&ei->i_prealloc_list);
513 inode_init_once(&ei->vfs_inode); 512 inode_init_once(&ei->vfs_inode);
513#ifdef CONFIG_REISERFS_FS_POSIX_ACL
514 ei->i_acl_access = NULL; 514 ei->i_acl_access = NULL;
515 ei->i_acl_default = NULL; 515 ei->i_acl_default = NULL;
516#endif
516 } 517 }
517} 518}
518 519
@@ -531,9 +532,7 @@ static int init_inodecache(void)
531 532
532static void destroy_inodecache(void) 533static void destroy_inodecache(void)
533{ 534{
534 if (kmem_cache_destroy(reiserfs_inode_cachep)) 535 kmem_cache_destroy(reiserfs_inode_cachep);
535 reiserfs_warning(NULL,
536 "reiserfs_inode_cache: not all structures were freed");
537} 536}
538 537
539/* we don't mark inodes dirty, we just log them */ 538/* we don't mark inodes dirty, we just log them */
@@ -563,6 +562,7 @@ static void reiserfs_dirty_inode(struct inode *inode)
563 reiserfs_write_unlock(inode->i_sb); 562 reiserfs_write_unlock(inode->i_sb);
564} 563}
565 564
565#ifdef CONFIG_REISERFS_FS_POSIX_ACL
566static void reiserfs_clear_inode(struct inode *inode) 566static void reiserfs_clear_inode(struct inode *inode)
567{ 567{
568 struct posix_acl *acl; 568 struct posix_acl *acl;
@@ -577,6 +577,9 @@ static void reiserfs_clear_inode(struct inode *inode)
577 posix_acl_release(acl); 577 posix_acl_release(acl);
578 REISERFS_I(inode)->i_acl_default = NULL; 578 REISERFS_I(inode)->i_acl_default = NULL;
579} 579}
580#else
581#define reiserfs_clear_inode NULL
582#endif
580 583
581#ifdef CONFIG_QUOTA 584#ifdef CONFIG_QUOTA
582static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, 585static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
@@ -726,12 +729,6 @@ static const arg_desc_t error_actions[] = {
726 {NULL, 0, 0}, 729 {NULL, 0, 0},
727}; 730};
728 731
729int reiserfs_default_io_size = 128 * 1024; /* Default recommended I/O size is 128k.
730 There might be broken applications that are
731 confused by this. Use nolargeio mount option
732 to get usual i/o size = PAGE_SIZE.
733 */
734
735/* proceed only one option from a list *cur - string containing of mount options 732/* proceed only one option from a list *cur - string containing of mount options
736 opts - array of options which are accepted 733 opts - array of options which are accepted
737 opt_arg - if option is found and requires an argument and if it is specifed 734 opt_arg - if option is found and requires an argument and if it is specifed
@@ -960,19 +957,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
960 } 957 }
961 958
962 if (c == 'w') { 959 if (c == 'w') {
963 char *p = NULL; 960 reiserfs_warning(s, "reiserfs: nolargeio option is no longer supported");
964 int val = simple_strtoul(arg, &p, 0); 961 return 0;
965
966 if (*p != '\0') {
967 reiserfs_warning(s,
968 "reiserfs_parse_options: non-numeric value %s for nolargeio option",
969 arg);
970 return 0;
971 }
972 if (val)
973 reiserfs_default_io_size = PAGE_SIZE;
974 else
975 reiserfs_default_io_size = 128 * 1024;
976 } 962 }
977 963
978 if (c == 'j') { 964 if (c == 'j') {
@@ -2204,7 +2190,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
2204 size_t towrite = len; 2190 size_t towrite = len;
2205 struct buffer_head tmp_bh, *bh; 2191 struct buffer_head tmp_bh, *bh;
2206 2192
2207 mutex_lock(&inode->i_mutex); 2193 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2208 while (towrite > 0) { 2194 while (towrite > 0) {
2209 tocopy = sb->s_blocksize - offset < towrite ? 2195 tocopy = sb->s_blocksize - offset < towrite ?
2210 sb->s_blocksize - offset : towrite; 2196 sb->s_blocksize - offset : towrite;
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index 196e971c03c9..36f108fc1cf5 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -2,7 +2,6 @@
2 * Copyright 1999 Hans Reiser, see reiserfs/README for licensing and copyright details 2 * Copyright 1999 Hans Reiser, see reiserfs/README for licensing and copyright details
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/time.h> 5#include <linux/time.h>
7#include <linux/pagemap.h> 6#include <linux/pagemap.h>
8#include <linux/buffer_head.h> 7#include <linux/buffer_head.h>
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 39fedaa88a0c..d935fb9394e3 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -424,7 +424,7 @@ int xattr_readdir(struct file *file, filldir_t filler, void *buf)
424 int res = -ENOTDIR; 424 int res = -ENOTDIR;
425 if (!file->f_op || !file->f_op->readdir) 425 if (!file->f_op || !file->f_op->readdir)
426 goto out; 426 goto out;
427 mutex_lock(&inode->i_mutex); 427 mutex_lock_nested(&inode->i_mutex, I_MUTEX_XATTR);
428// down(&inode->i_zombie); 428// down(&inode->i_zombie);
429 res = -ENOENT; 429 res = -ENOENT;
430 if (!IS_DEADDIR(inode)) { 430 if (!IS_DEADDIR(inode)) {