Whamcloud - gitweb
65d49d450f039f23b354439fb981797d851f501e
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles12 / ext4-misc.patch
1 Index: linux-3.12.39-47.1/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-3.12.39-47.1.orig/fs/ext4/ext4.h
4 +++ linux-3.12.39-47.1/fs/ext4/ext4.h
5 @@ -1431,6 +1431,8 @@ static inline void ext4_clear_state_flag
6  
7  #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
8  
9 +#define JOURNAL_START_HAS_3ARGS        1
10 +
11  /*
12   * Codes for operating systems
13   */
14 @@ -2694,6 +2696,11 @@ struct ext4_extent;
15  
16  extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
17  extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
18 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
19 +                                                 ext4_group_t block_group);
20 +extern struct buffer_head *ext4_append(handle_t *handle,
21 +                                      struct inode *inode,
22 +                                      ext4_lblk_t *block);
23  extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
24  extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
25                                struct ext4_map_blocks *map, int flags);
26 Index: linux-3.12.39-47.1/fs/ext4/namei.c
27 ===================================================================
28 --- linux-3.12.39-47.1.orig/fs/ext4/namei.c
29 +++ linux-3.12.39-47.1/fs/ext4/namei.c
30 @@ -48,7 +48,7 @@
31  #define NAMEI_RA_BLOCKS  4
32  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
33  
34 -static struct buffer_head *ext4_append(handle_t *handle,
35 +struct buffer_head *ext4_append(handle_t *handle,
36                                         struct inode *inode,
37                                         ext4_lblk_t *block)
38  {
39 @@ -71,6 +2200,7 @@ out:
40                 return ERR_PTR(err);
41         inode->i_size += inode->i_sb->s_blocksize;
42         EXT4_I(inode)->i_disksize = inode->i_size;
43 +       BUFFER_TRACE(bh, "get_write_access");
44         err = ext4_journal_get_write_access(handle, bh);
45         if (err) {
46                 brelse(bh);
47 @@ -154,6 +154,7 @@ static struct buffer_head *__ext4_read_d
48         }
49         return bh;
50  }
51 +EXPORT_SYMBOL(ext4_append);
52  
53  #ifndef assert
54  #define assert(test) J_ASSERT(test)
55 @@ -2199,7 +2200,7 @@ out:
56   * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
57   * since this indicates that nlinks count was previously 1.
58   */
59 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
60 +void ext4_inc_count(handle_t *handle, struct inode *inode)
61  {
62         inc_nlink(inode);
63         if (is_dx(inode) && inode->i_nlink > 1) {
64 @@ -2211,16 +2212,18 @@ static void ext4_inc_count(handle_t *han
65                 }
66         }
67  }
68 +EXPORT_SYMBOL(ext4_inc_count);
69  
70  /*
71   * If a directory had nlink == 1, then we should let it be 1. This indicates
72   * directory has >EXT4_LINK_MAX subdirs.
73   */
74 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
75 +void ext4_dec_count(handle_t *handle, struct inode *inode)
76  {
77         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
78                 drop_nlink(inode);
79  }
80 +EXPORT_SYMBOL(ext4_dec_count);
81  
82  
83  static int ext4_add_nondir(handle_t *handle,
84 @@ -2402,7 +2426,7 @@ out:
85         if (IS_DIRSYNC(dir))
86                 ext4_handle_sync(handle);
87  
88 -       inode->i_op = &ext4_dir_inode_operations.ops;
89 +       inode->i_op = &ext4_dir_inode_operations;
90         inode->i_fop = &ext4_dir_operations;
91         return ext4_init_new_dir(handle, dir, inode);
92  }
93 Index: linux-3.12.39-47.1/fs/ext4/ialloc.c
94 ===================================================================
95 --- linux-3.12.39-47.1.orig/fs/ext4/ialloc.c
96 +++ linux-3.12.39-47.1/fs/ext4/ialloc.c
97 @@ -109,7 +109,7 @@ void ext4_end_bitmap_read(struct buffer_
98   *
99   * Return buffer_head of bitmap on success or NULL.
100   */
101 -static struct buffer_head *
102 +struct buffer_head *
103  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
104  {
105         struct ext4_group_desc *desc;
106 @@ -192,6 +192,7 @@ verify:
107         set_buffer_verified(bh);
108         return bh;
109  }
110 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
111  
112  /*
113   * NOTE! When we get the inode, we're the only people
114 Index: linux-3.12.39-47.1/fs/ext4/inode.c
115 ===================================================================
116 --- linux-3.12.39-47.1.orig/fs/ext4/inode.c
117 +++ linux-3.12.39-47.1/fs/ext4/inode.c
118 @@ -5186,3 +5186,17 @@ out:
119         sb_end_pagefault(inode->i_sb);
120         return ret;
121  }
122 +EXPORT_SYMBOL(ext4_map_blocks);
123 +EXPORT_SYMBOL(ext4_truncate);
124 +EXPORT_SYMBOL(ext4_iget);
125 +EXPORT_SYMBOL(ext4_bread);
126 +EXPORT_SYMBOL(ext4_itable_unused_count);
127 +EXPORT_SYMBOL(ext4_force_commit);
128 +EXPORT_SYMBOL(ext4_mark_inode_dirty);
129 +EXPORT_SYMBOL(ext4_get_group_desc);
130 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
131 +EXPORT_SYMBOL(__ext4_journal_start_sb);
132 +EXPORT_SYMBOL(__ext4_journal_stop);
133 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
134 +EXPORT_SYMBOL(__ext4_std_error);
135 +EXPORT_SYMBOL(ext4fs_dirhash);
136 Index: linux-3.12.39-47.1/fs/ext4/mballoc.c
137 ===================================================================
138 --- linux-3.12.39-47.1.orig/fs/ext4/mballoc.c
139 +++ linux-3.12.39-47.1/fs/ext4/mballoc.c
140 @@ -759,6 +759,9 @@ void ext4_mb_generate_buddy(struct super
141                  * corrupt and update bb_free using bitmap value
142                  */
143                 grp->bb_free = free;
144 +               if (!EXT4_MB_GRP_BBITMAP_CORRUPT(grp))
145 +                       percpu_counter_sub(&sbi->s_freeclusters_counter,
146 +                                          grp->bb_free);
147                 set_bit(EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT, &grp->bb_state);
148         }
149         mb_set_largest_free_order(sb, grp);
150 Index: linux-3.12.39-47.1/fs/ext4/xattr.c
151 ===================================================================
152 --- linux-3.12.39-47.1.orig/fs/ext4/xattr.c
153 +++ linux-3.12.39-47.1/fs/ext4/xattr.c
154 @@ -541,6 +541,7 @@ ext4_xattr_release_block(handle_t *handl
155         int error = 0;
156  
157         ce = mb_cache_entry_get(ext4_xattr_cache, bh->b_bdev, bh->b_blocknr);
158 +       BUFFER_TRACE(bh, "get_write_access");
159         error = ext4_journal_get_write_access(handle, bh);
160         if (error)
161                 goto out;
162 @@ -781,6 +782,7 @@ ext4_xattr_block_set(handle_t *handle, s
163         if (s->base) {
164                 ce = mb_cache_entry_get(ext4_xattr_cache, bs->bh->b_bdev,
165                                         bs->bh->b_blocknr);
166 +               BUFFER_TRACE(bs->bh, "get_write_access");
167                 error = ext4_journal_get_write_access(handle, bs->bh);
168                 if (error)
169                         goto cleanup;