Whamcloud - gitweb
LU-12904 ldiskfs: Add ldiskfs support for linux 5.4
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / linux-5.4 / export-ext4fs-dirhash-helper.patch
1 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
2 index bb6b6be..35ef40b 100644
3 --- a/fs/ext4/ext4.h
4 +++ b/fs/ext4/ext4.h
5 @@ -2585,6 +2585,9 @@ extern int ext4_sync_file(struct file *, loff_t, loff_t, int);
6  extern int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
7                           struct dx_hash_info *hinfo);
8  
9 +extern int __ext4fs_dirhash(const char *name, int len,
10 +                           struct dx_hash_info *hinfo);
11 +
12  /* ialloc.c */
13  extern struct inode *__ext4_new_inode(handle_t *, struct inode *, umode_t,
14                                       const struct qstr *qstr, __u32 goal,
15 diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
16 index d358bfc..f7d575a 100644
17 --- a/fs/ext4/hash.c
18 +++ b/fs/ext4/hash.c
19 @@ -197,8 +197,8 @@ static void str2hashbuf_unsigned(const char *msg, int len, __u32 *buf, int num)
20   * represented, and whether or not the returned hash is 32 bits or 64
21   * bits.  32 bit hashes will return 0 for the minor hash.
22   */
23 -static int __ext4fs_dirhash(const char *name, int len,
24 -                           struct dx_hash_info *hinfo)
25 +int __ext4fs_dirhash(const char *name, int len,
26 +                    struct dx_hash_info *hinfo)
27  {
28         __u32   hash;
29         __u32   minor_hash = 0;
30 @@ -270,6 +270,7 @@ static int __ext4fs_dirhash(const char *name, int len,
31         hinfo->minor_hash = minor_hash;
32         return 0;
33  }
34 +EXPORT_SYMBOL(__ext4fs_dirhash);
35  
36  int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
37                    struct dx_hash_info *hinfo)