Whamcloud - gitweb
LU-15544 ldiskfs: SUSE 15 SP4 kernel 5.14.21 SUSE
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / linux-5.14 / export-ext4fs-dirhash-helper.patch
1 Subject: [PATCH] linux-5.14/export-ext4fs-dirhash-helper
2
3 ---
4  fs/ext4/ext4.h | 3 +++
5  fs/ext4/hash.c | 5 +++--
6  2 files changed, 6 insertions(+), 2 deletions(-)
7
8 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
9 index 083c109..09d8720 100644
10 --- a/fs/ext4/ext4.h
11 +++ b/fs/ext4/ext4.h
12 @@ -2996,6 +2996,9 @@ extern int ext4_sync_file(struct file *, loff_t, loff_t, int);
13  extern int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
14                           struct dx_hash_info *hinfo);
15  
16 +extern int __ext4fs_dirhash(const struct inode *dir, const char *name, int len,
17 +                           struct dx_hash_info *hinfo);
18 +
19  /* ialloc.c */
20  extern int ext4_mark_inode_used(struct super_block *sb, int ino);
21  extern struct inode *__ext4_new_inode(struct user_namespace *, handle_t *,
22 diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
23 index f34f417..a41bd48 100644
24 --- a/fs/ext4/hash.c
25 +++ b/fs/ext4/hash.c
26 @@ -197,8 +197,8 @@ static void str2hashbuf_unsigned(const char *msg, int len, __u32 *buf, int num)
27   * represented, and whether or not the returned hash is 32 bits or 64
28   * bits.  32 bit hashes will return 0 for the minor hash.
29   */
30 -static int __ext4fs_dirhash(const struct inode *dir, const char *name, int len,
31 -                           struct dx_hash_info *hinfo)
32 +int __ext4fs_dirhash(const struct inode *dir, const char *name, int len,
33 +                    struct dx_hash_info *hinfo)
34  {
35         __u32   hash;
36         __u32   minor_hash = 0;
37 @@ -286,6 +286,7 @@ static int __ext4fs_dirhash(const struct inode *dir, const char *name, int len,
38         hinfo->minor_hash = minor_hash;
39         return 0;
40  }
41 +EXPORT_SYMBOL(__ext4fs_dirhash);
42  
43  int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
44                    struct dx_hash_info *hinfo)
45 -- 
46 2.31.1
47