Whamcloud - gitweb
- missed patches from suse-2.4.21-2 series added
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-orphan_lock-2.4.19-suse.patch
1 Index: linux-2.4.19/fs/ext3/namei.c
2 ===================================================================
3 --- linux-2.4.19.orig/fs/ext3/namei.c   2004-04-23 22:36:03.000000000 -0400
4 +++ linux-2.4.19/fs/ext3/namei.c        2004-04-23 22:37:37.000000000 -0400
5 @@ -1751,8 +1751,8 @@
6         struct super_block *sb = inode->i_sb;
7         struct ext3_iloc iloc;
8         int err = 0, rc;
9 -       
10 -       lock_super(sb);
11 +
12 +       down(&EXT3_SB(sb)->s_orphan_lock);
13         if (!list_empty(&EXT3_I(inode)->i_orphan))
14                 goto out_unlock;
15  
16 @@ -1800,7 +1800,7 @@
17         jbd_debug(4, "orphan inode %ld will point to %d\n",
18                         inode->i_ino, NEXT_ORPHAN(inode));
19  out_unlock:
20 -       unlock_super(sb);
21 +       up(&EXT3_SB(sb)->s_orphan_lock);
22         ext3_std_error(inode->i_sb, err);
23         return err;
24  }
25 @@ -1813,20 +1813,19 @@
26  {
27         struct list_head *prev;
28          struct ext3_inode_info *ei = EXT3_I(inode);
29 -       struct ext3_sb_info *sbi;
30 +       struct ext3_sb_info *sbi = EXT3_SB(inode->i_sb);
31         unsigned long ino_next;
32         struct ext3_iloc iloc;
33         int err = 0;
34  
35 -       lock_super(inode->i_sb);
36 +        down(&sbi->s_orphan_lock);
37          if (list_empty(&ei->i_orphan)) {
38 -               unlock_super(inode->i_sb);
39 +                up(&sbi->s_orphan_lock);
40                 return 0;
41         }
42  
43         ino_next = NEXT_ORPHAN(inode);
44          prev = ei->i_orphan.prev;
45 -       sbi = EXT3_SB(inode->i_sb);
46  
47         jbd_debug(4, "remove inode %lu from orphan list\n", inode->i_ino);
48  
49 @@ -1872,10 +1871,10 @@
50         if (err)
51                 goto out_brelse;
52  
53 -out_err: 
54 +out_err:
55         ext3_std_error(inode->i_sb, err);
56  out:
57 -       unlock_super(inode->i_sb);
58 +       up(&sbi->s_orphan_lock);
59         return err;
60  
61  out_brelse:
62 Index: linux-2.4.19/fs/ext3/super.c
63 ===================================================================
64 --- linux-2.4.19.orig/fs/ext3/super.c   2004-04-23 22:30:41.000000000 -0400
65 +++ linux-2.4.19/fs/ext3/super.c        2004-04-23 22:36:22.000000000 -0400
66 @@ -1179,6 +1179,7 @@
67          */
68         sb->s_op = &ext3_sops;
69         INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
70 +       sema_init(&sbi->s_orphan_lock, 1);
71  
72         sb->s_root = 0;
73  
74 Index: linux-2.4.19/include/linux/ext3_fs_sb.h
75 ===================================================================
76 --- linux-2.4.19.orig/include/linux/ext3_fs_sb.h        2004-04-23 18:26:27.000000000 -0400
77 +++ linux-2.4.19/include/linux/ext3_fs_sb.h     2004-04-23 22:36:22.000000000 -0400
78 @@ -69,6 +69,7 @@
79         struct inode * s_journal_inode;
80         struct journal_s * s_journal;
81         struct list_head s_orphan;
82 +       struct semaphore s_orphan_lock;
83         struct block_device *journal_bdev;
84  #ifdef CONFIG_JBD_DEBUG
85         struct timer_list turn_ro_timer;        /* For turning read-only (crash simulation) */