Whamcloud - gitweb
LU-11851 ldiskfs: reschedule for htree thread.
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ubuntu14+16 / ext4-misc.patch
1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index 574a6c9..97d3432 100644
3 --- a/fs/ext4/ext4.h
4 +++ b/fs/ext4/ext4.h
5 @@ -1581,6 +1581,8 @@ static inline int ext4_encrypted_inode(struct inode *inode)
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 @@ -1812,7 +1814,21 @@ static inline bool ext4_has_unknown_ext##ver##_incompat_features(struct super_bl
15  
16  EXTN_FEATURE_FUNCS(2)
17  EXTN_FEATURE_FUNCS(3)
18 -EXTN_FEATURE_FUNCS(4)
19 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
20 +{
21 +       return ((EXT4_SB(sb)->s_es->s_feature_compat &
22 +               cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
23 +}
24 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
25 +{
26 +       return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
27 +               cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
28 +}
29 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
30 +{
31 +       return ((EXT4_SB(sb)->s_es->s_feature_incompat &
32 +               cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
33 +}
34  
35  static inline bool ext4_has_compat_features(struct super_block *sb)
36  {
37 @@ -3149,6 +3165,11 @@ struct ext4_extent;
38  
39  extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
40  extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
41 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
42 +                                                 ext4_group_t block_group);
43 +extern struct buffer_head *ext4_append(handle_t *handle,
44 +                                      struct inode *inode,
45 +                                      ext4_lblk_t *block);
46  extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
47  extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
48                                struct ext4_map_blocks *map, int flags);
49 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
50 index 38a740f..0cccda3 100644
51 --- a/fs/ext4/ialloc.c
52 +++ b/fs/ext4/ialloc.c
53 @@ -153,7 +153,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb,
54   *
55   * Return buffer_head of bitmap on success or NULL.
56   */
57 -static struct buffer_head *
58 +struct buffer_head *
59  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
60  {
61         struct ext4_group_desc *desc;
62 @@ -233,6 +233,7 @@ out:
63         put_bh(bh);
64         return ERR_PTR(err);
65  }
66 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
67  
68  /*
69   * NOTE! When we get the inode, we're the only people
70 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
71 index 296760b..04c5f63 100644
72 --- a/fs/ext4/inode.c
73 +++ b/fs/ext4/inode.c
74 @@ -5452,6 +5452,20 @@ out:
75         sb_end_pagefault(inode->i_sb);
76         return ret;
77  }
78 +EXPORT_SYMBOL(ext4_map_blocks);
79 +EXPORT_SYMBOL(ext4_truncate);
80 +EXPORT_SYMBOL(ext4_iget);
81 +EXPORT_SYMBOL(ext4_bread);
82 +EXPORT_SYMBOL(ext4_itable_unused_count);
83 +EXPORT_SYMBOL(ext4_force_commit);
84 +EXPORT_SYMBOL(ext4_mark_inode_dirty);
85 +EXPORT_SYMBOL(ext4_get_group_desc);
86 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
87 +EXPORT_SYMBOL(__ext4_journal_start_sb);
88 +EXPORT_SYMBOL(__ext4_journal_stop);
89 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
90 +EXPORT_SYMBOL(__ext4_std_error);
91 +EXPORT_SYMBOL(ext4fs_dirhash);
92  
93  int ext4_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
94  {
95 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
96 index 6bcf0ca..02368cb 100644
97 --- a/fs/ext4/mballoc.c
98 +++ b/fs/ext4/mballoc.c
99 @@ -723,7 +723,6 @@ void ext4_mb_generate_buddy(struct super_block *sb,
100                                 void *buddy, void *bitmap, ext4_group_t group)
101  {
102         struct ext4_group_info *grp = ext4_get_group_info(sb, group);
103 -       struct ext4_sb_info *sbi = EXT4_SB(sb);
104         ext4_grpblk_t max = EXT4_CLUSTERS_PER_GROUP(sb);
105         ext4_grpblk_t i = 0;
106         ext4_grpblk_t first;
107 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
108 index aaa388a..36635b6 100644
109 --- a/fs/ext4/namei.c
110 +++ b/fs/ext4/namei.c
111 @@ -47,7 +47,7 @@
112  #define NAMEI_RA_BLOCKS  4
113  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
114  
115 -static struct buffer_head *ext4_append(handle_t *handle,
116 +struct buffer_head *ext4_append(handle_t *handle,
117                                         struct inode *inode,
118                                         ext4_lblk_t *block)
119  {
120 @@ -157,6 +157,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
121         }
122         return bh;
123  }
124 +EXPORT_SYMBOL(ext4_append);
125  
126  #ifndef assert
127  #define assert(test) J_ASSERT(test)
128 @@ -2407,7 +2408,7 @@ EXPORT_SYMBOL(ext4_delete_entry);
129   * DIR_NLINK feature is set if 1) nlinks > EXT4_LINK_MAX or 2) nlinks == 2,
130   * since this indicates that nlinks count was previously 1.
131   */
132 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
133 +void ext4_inc_count(handle_t *handle, struct inode *inode)
134  {
135         inc_nlink(inode);
136         if (is_dx(inode) && inode->i_nlink > 1) {
137 @@ -2418,16 +2419,18 @@ static void ext4_inc_count(handle_t *handle, struct inode *inode)
138                 }
139         }
140  }
141 +EXPORT_SYMBOL(ext4_inc_count);
142  
143  /*
144   * If a directory had nlink == 1, then we should let it be 1. This indicates
145   * directory has >EXT4_LINK_MAX subdirs.
146   */
147 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
148 +void ext4_dec_count(handle_t *handle, struct inode *inode)
149  {
150         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
151                 drop_nlink(inode);
152  }
153 +EXPORT_SYMBOL(ext4_dec_count);
154  
155  
156  static int ext4_add_nondir(handle_t *handle,