Whamcloud - gitweb
- configurable stack size fo x86_64
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-orphan_lock-2.4.22-rh.patch
1  fs/ext3/namei.c                 |   15 +++++++--------
2  fs/ext3/namei.c.orig            |   21 +++++++++++++++------
3  fs/ext3/super.c                 |    1 +
4  include/linux/ext3_fs_sb.h      |    1 +
5  include/linux/ext3_fs_sb.h.orig |    2 ++
6  5 files changed, 26 insertions(+), 14 deletions(-)
7
8 --- linux-2.4.22-ac1/fs/ext3/namei.c~ext3-orphan_lock-2.4.22-rh 2003-09-26 00:24:09.000000000 +0400
9 +++ linux-2.4.22-ac1-alexey/fs/ext3/namei.c     2003-09-26 00:26:36.000000000 +0400
10 @@ -1748,8 +1748,8 @@ int ext3_orphan_add(handle_t *handle, st
11         struct super_block *sb = inode->i_sb;
12         struct ext3_iloc iloc;
13         int err = 0, rc;
14 -       
15 -       lock_super(sb);
16 +
17 +       down(&EXT3_SB(sb)->s_orphan_lock);
18         if (!list_empty(&EXT3_I(inode)->i_orphan))
19                 goto out_unlock;
20  
21 @@ -1797,7 +1797,7 @@ int ext3_orphan_add(handle_t *handle, st
22         jbd_debug(4, "orphan inode %ld will point to %d\n",
23                         inode->i_ino, NEXT_ORPHAN(inode));
24  out_unlock:
25 -       unlock_super(sb);
26 +       up(&EXT3_SB(sb)->s_orphan_lock);
27         ext3_std_error(inode->i_sb, err);
28         return err;
29  }
30 @@ -1810,20 +1810,19 @@ int ext3_orphan_del(handle_t *handle, st
31  {
32         struct list_head *prev;
33         struct ext3_inode_info *ei = EXT3_I(inode);
34 -       struct ext3_sb_info *sbi;
35 +       struct ext3_sb_info *sbi = EXT3_SB(inode->i_sb);
36         unsigned long ino_next;
37         struct ext3_iloc iloc;
38         int err = 0;
39  
40 -       lock_super(inode->i_sb);
41 +       down(&sbi->s_orphan_lock);
42         if (list_empty(&ei->i_orphan)) {
43 -               unlock_super(inode->i_sb);
44 +               up(&sbi->s_orphan_lock);
45                 return 0;
46         }
47  
48         ino_next = NEXT_ORPHAN(inode);
49         prev = ei->i_orphan.prev;
50 -       sbi = EXT3_SB(inode->i_sb);
51  
52         jbd_debug(4, "remove inode %lu from orphan list\n", inode->i_ino);
53  
54 @@ -1872,7 +1871,7 @@ int ext3_orphan_del(handle_t *handle, st
55  out_err:
56         ext3_std_error(inode->i_sb, err);
57  out:
58 -       unlock_super(inode->i_sb);
59 +       up(&sbi->s_orphan_lock);
60         return err;
61  
62  out_brelse:
63 --- linux-2.4.22-ac1/fs/ext3/super.c~ext3-orphan_lock-2.4.22-rh 2003-09-26 00:24:09.000000000 +0400
64 +++ linux-2.4.22-ac1-alexey/fs/ext3/super.c     2003-09-26 00:25:22.000000000 +0400
65 @@ -1164,6 +1164,7 @@ struct super_block * ext3_read_super (st
66         sb->s_op = &ext3_sops;
67         sb->dq_op = &ext3_qops;
68         INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
69 +       sema_init(&sbi->s_orphan_lock, 1);
70  
71         sb->s_root = 0;
72  
73 --- linux-2.4.22-ac1/include/linux/ext3_fs_sb.h~ext3-orphan_lock-2.4.22-rh      2003-09-26 00:24:08.000000000 +0400
74 +++ linux-2.4.22-ac1-alexey/include/linux/ext3_fs_sb.h  2003-09-26 00:25:22.000000000 +0400
75 @@ -72,6 +72,7 @@ struct ext3_sb_info {
76         struct inode * s_journal_inode;
77         struct journal_s * s_journal;
78         struct list_head s_orphan;
79 +       struct semaphore s_orphan_lock;
80         unsigned long s_commit_interval;
81         struct block_device *journal_bdev;
82  #ifdef CONFIG_JBD_DEBUG