Whamcloud - gitweb
dcf3f33d56d6aabe2e4eac2d9c94fb8678e868b4
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-nlink-2.6.patch
1 Index: linux-stage/fs/ext4/namei.c
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/namei.c
4 +++ linux-stage/fs/ext4/namei.c
5 @@ -1609,7 +1709,7 @@ static void ext4_inc_count(handle_t *han
6   * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
7   * since this indicates that nlinks count was previously 1.
8   */
9 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
10 +void ext4_inc_count(handle_t *handle, struct inode *inode)
11  {
12         inc_nlink(inode);
13         if (is_dx(inode) && inode->i_nlink > 1) {
14 @@ -1709,17 +1709,18 @@ static void ext4_inc_count(handle_t *han
15                 }
16         }
17  }
18 +EXPORT_SYMBOL(ext4_inc_count);
19  
20  /*
21   * If a directory had nlink == 1, then we should let it be 1. This indicates
22   * directory has >EXT4_LINK_MAX subdirs.
23   */
24 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
25 +void ext4_dec_count(handle_t *handle, struct inode *inode)
26  {
27 -       drop_nlink(inode);
28 -       if (S_ISDIR(inode->i_mode) && inode->i_nlink == 0)
29 -               inc_nlink(inode);
30 +       if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
31 +               drop_nlink(inode);
32  }
33 +EXPORT_SYMBOL(ext4_dec_count);
34  
35  
36  static int ext4_add_nondir(handle_t *handle,