Whamcloud - gitweb
LU-16351 llite: Linux 6.1 prandom, folios_contig, vma_iterator 00/54700/3
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 10 Apr 2024 07:45:22 +0000 (00:45 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 4 May 2024 03:00:30 +0000 (03:00 +0000)
Linux commit v4.10-rc3-6-gc440408cf690
  random: convert get_random_int/long into get_random_u32/u64
Linux commit v6.0-11338-gde492c83cae0
  prandom: remove unused functions

prandom_u32 is a wrapper around get_random_u32, change users
of prandom_u32 to get_random_u32 and provide a fallback
to prandom_u32 when get_random_u32 is not available.

Linux commit v6.0-rc1-2-g25885a35a720
  Change calling conventions for filldir_t
Add a test for the new filldir_t signature
Provide wrappers for transition from int (error code) to bool

Linux commit v6.0-rc3-94-g35b471467f88
  filemap: add filemap_get_folios_contig()
Provide a wrapper and fallback to find_get_pages_contig

Linux commit v6.0-rc3-225-gf39af05949a4
  mm: add VMA iterator
Use vma_iterator and for_each_vma when available.

Lustre-change: https://review.whamcloud.com/49232
Lustre-commit: ca992899d55fd13e65b75ace02931daaa29c18bd

Test-Parameters: trivial
HPE-bug-id: LUS-11377
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I23dc23d0252e1995555b6685f5cf7c207edf642b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54700
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
contrib/scripts/spelling.txt
lustre/autoconf/lustre-core.m4
lustre/llite/llite_mmap.c
lustre/llite/llite_nfs.c
lustre/llite/vvp_dev.c
lustre/obdclass/llog_test.c
lustre/obdclass/lu_object.c
lustre/obdclass/lu_tgt_descs.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_scrub.c

index 5e34d04..c011c83 100644 (file)
@@ -84,7 +84,7 @@ CFS_PAGE_MASK||PAGE_MASK
 CFS_PAGE_SIZE||PAGE_SIZE
 cfs_proc_dir_entry_t||struct proc_dir_entry
 cfs_rcu_head_t||struct rcu_head
-cfs_rand||prandom_u32
+cfs_rand||get_random_u32
 cfs_srand||add_device_randomness
 cfs_trimwhite||strim
 cfs_time_add_64||ktime_add
@@ -197,6 +197,7 @@ PAGE_CACHE_MASK||PAGE_MASK
 page_cache_release||put_page
 PAGE_CACHE_SHIFT||PAGE_SHIFT
 PAGE_CACHE_SIZE||PAGE_SIZE
+prandom_u32||get_random_u32
 return seq_printf||seq_printf
 setup_timer||cfs_timer_setup
 = seq_printf||seq_printf
index 8e32757..dd1df49 100644 (file)
@@ -3455,6 +3455,97 @@ AC_DEFUN([LC_HAVE_GET_EXPIRY_TIME64_T], [
 ]) # LC_HAVE_GET_EXPIRY_TIME64_T
 
 #
+# LC_HAVE_GET_RANDOM_U32_AND_U64
+#
+# Linux commit v4.10-rc3-6-gc440408cf690
+#   random: convert get_random_int/long into get_random_u32/u64
+# Linux commit v6.0-11338-gde492c83cae0
+#   prandom: remove unused functions
+#
+AC_DEFUN([LC_SRC_HAVE_GET_RANDOM_U32_AND_U64], [
+       LB2_LINUX_TEST_SRC([get_random_u32_and_u64], [
+               #include <linux/random.h>
+       ],[
+               u32 rand32 = get_random_u32();
+               u64 rand64 = get_random_u64();
+               (void)rand32;
+               (void)rand64;
+       ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_GET_RANDOM_U32_AND_U64], [
+       AC_MSG_CHECKING([if get_random_u32() and get_random_u64() are available])
+       LB2_LINUX_TEST_RESULT([get_random_u32_and_u64], [
+               AC_DEFINE(HAVE_GET_RANDOM_U32_AND_U64, 1,
+                       [get_random_[u32|u64] are available])
+       ],[
+               AC_DEFINE([get_random_u32()], [prandom_u32()],
+                       [get_random_u32() is not available, use prandom_u32])
+       ])
+]) # LC_HAVE_GET_RANDOM_U32_AND_U64
+
+#
+# LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
+#
+# Linux commit v6.0-rc1-2-g25885a35a720
+#  Change calling conventions for filldir_t
+#
+AC_DEFUN([LC_SRC_NFS_FILLDIR_USE_CTX_RETURN_BOOL], [
+       LB2_LINUX_TEST_SRC([filldir_ctx_return_bool], [
+               #include <linux/fs.h>
+       ],[
+               bool filldir(struct dir_context *ctx, const char* name,
+                            int i, loff_t off, u64 tmp, unsigned temp)
+               {
+                       return 0;
+               }
+
+               struct dir_context ctx = {
+                       .actor = filldir,
+               };
+
+               ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
+       ],[-Werror])
+])
+AC_DEFUN([LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL], [
+       AC_MSG_CHECKING([if filldir_t uses struct dir_context and returns bool])
+       LB2_LINUX_TEST_RESULT([filldir_ctx_return_bool], [
+               AC_DEFINE(HAVE_FILLDIR_USE_CTX_RETURN_BOOL, 1,
+                       [filldir_t needs struct dir_context and returns bool])
+               AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
+                       [filldir_t needs struct dir_context as argument])
+               AC_DEFINE(FILLDIR_TYPE, bool,
+                       [filldir_t return type is bool or int])
+       ],[
+               AC_DEFINE(FILLDIR_TYPE, int,
+                       [filldir_t return type is bool or int])
+       ])
+]) # LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
+
+#
+# LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
+#
+# Linux commit v6.0-rc3-94-g35b471467f88
+#   filemap: add filemap_get_folios_contig()
+#
+AC_DEFUN([LC_SRC_HAVE_FILEMAP_GET_FOLIOS_CONTIG], [
+       LB2_LINUX_TEST_SRC([filemap_get_folios_contig], [
+               #include <linux/pagemap.h>
+       ],[
+               struct address_space *m = NULL;
+               pgoff_t start = 0;
+               struct folio_batch *fbatch = NULL;
+               (void)filemap_get_folios_contig(m, &start, ULONG_MAX, fbatch);
+       ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG], [
+       AC_MSG_CHECKING([if filemap_get_folios_contig() is available])
+       LB2_LINUX_TEST_RESULT([filemap_get_folios_contig], [
+               AC_DEFINE(HAVE_FILEMAP_GET_FOLIOS_CONTIG, 1,
+                       [filemap_get_folios_contig() is available])
+       ])
+]) # LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -3681,6 +3772,11 @@ AC_DEFUN([LC_PROG_LINUX_SRC], [
        LC_SRC_HAVE_CLASS_CREATE_MODULE_ARG
        LC_SRC_HAVE_GET_EXPIRY_TIME64_T
 
+       # 6.1
+       LC_SRC_HAVE_GET_RANDOM_U32_AND_U64
+       LC_SRC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
+       LC_SRC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
+
        # kernel patch to extend integrity interface
        LC_SRC_BIO_INTEGRITY_PREP_FN
 ])
@@ -3920,6 +4016,11 @@ AC_DEFUN([LC_PROG_LINUX_RESULTS], [
        LC_HAVE_CLASS_CREATE_MODULE_ARG
        LC_HAVE_GET_EXPIRY_TIME64_T
 
+       # 6.1
+       LC_HAVE_GET_RANDOM_U32_AND_U64
+       LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
+       LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
+
        # kernel patch to extend integrity interface
        LC_BIO_INTEGRITY_PREP_FN
 ])
index 1485a29..16d73eb 100644 (file)
@@ -51,18 +51,32 @@ void policy_from_vma(union ldlm_policy_data *policy, struct vm_area_struct *vma,
                               ~PAGE_MASK;
 }
 
+/*
+ * Linux commit v6.0-rc3-225-gf39af05949a4
+ * mm: add VMA iterator
+ */
+#ifndef VMA_ITERATOR
+#define vma_iterator vm_area_struct *
+#define vma_iter_init(vmip, mm, addr) *(vmip) = find_vma(mm, addr)
+#define for_each_vma(vmi, vma) \
+       for (vma = vmi; vma != NULL; vma = vma->vm_next)
+#endif
+
 struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
-                               size_t count)
+                              size_t count)
 {
        struct vm_area_struct *vma, *ret = NULL;
+       struct vma_iterator vmi;
+
        ENTRY;
 
        /* mmap_lock must have been held by caller. */
        LASSERT(!mmap_write_trylock(mm));
 
-       for (vma = find_vma(mm, addr);
-            vma != NULL && vma->vm_start < (addr + count);
-            vma = vma->vm_next) {
+       vma_iter_init(&vmi, mm, addr);
+       for_each_vma(vmi, vma) {
+               if (vma->vm_start < (addr + count))
+                       break;
                if (vma->vm_ops && vma->vm_ops == &ll_file_vm_ops &&
                    vma->vm_flags & VM_SHARED) {
                        ret = vma;
index 644aac2..7d16d9d 100644 (file)
@@ -198,19 +198,10 @@ static int ll_encode_fh(struct inode *inode, u32 *fh, int *plen,
        RETURN(FILEID_LUSTRE);
 }
 
-static int
-#ifndef HAVE_FILLDIR_USE_CTX
-ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,
-                       loff_t hash, u64 ino, unsigned type)
+static inline int
+do_nfs_get_name_filldir(struct ll_getname_data *lgd, const char *name,
+                       int namelen, loff_t hash, u64 ino, unsigned int type)
 {
-       struct ll_getname_data *lgd = cookie;
-#else
-ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name, int namelen,
-                       loff_t hash, u64 ino, unsigned type)
-{
-       struct ll_getname_data *lgd =
-               container_of(ctx, struct ll_getname_data, ctx);
-#endif /* HAVE_FILLDIR_USE_CTX */
        /*
         * It is hack to access lde_fid for comparison with lgd_fid.
         * So the input 'name' must be part of the 'lu_dirent', and
@@ -232,11 +223,41 @@ ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name, int namelen,
                lgd->lgd_name[namelen] = 0;
                lgd->lgd_found = 1;
        }
-        return lgd->lgd_found;
+       return lgd->lgd_found;
+}
+
+#ifdef HAVE_FILLDIR_USE_CTX_RETURN_BOOL
+static bool
+ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name, int namelen,
+                       loff_t hash, u64 ino, unsigned int type)
+{
+       struct ll_getname_data *lgd =
+               container_of(ctx, struct ll_getname_data, ctx);
+       int err = do_nfs_get_name_filldir(lgd, name, namelen, hash, ino, type);
+
+       return err == 0;
+}
+#elif defined(HAVE_FILLDIR_USE_CTX)
+static int
+ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name, int namelen,
+                       loff_t hash, u64 ino, unsigned int type)
+{
+       struct ll_getname_data *lgd =
+               container_of(ctx, struct ll_getname_data, ctx);
+
+       return do_nfs_get_name_filldir(lgd, name, namelen, hash, ino, type);
 }
+#else
+static int ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,
+                                  loff_t hash, u64 ino, unsigned int type)
+{
+       struct ll_getname_data *lgd = cookie;
+
+       return do_nfs_get_name_filldir(lgd, name, namelen, hash, ino, type);
+}
+#endif /* HAVE_FILLDIR_USE_CTX */
 
-static int ll_get_name(struct dentry *dentry, char *name,
-                       struct dentry *child)
+static int ll_get_name(struct dentry *dentry, char *name, struct dentry *child)
 {
        struct inode *dir = dentry->d_inode;
        struct ll_getname_data lgd = {
index 4d7995f..d5bb6c1 100644 (file)
@@ -386,6 +386,28 @@ struct vvp_seq_private {
        loff_t                  vvp_prev_pos;
 };
 
+unsigned int ll_filemap_get_one_page_contig(struct address_space *mapping,
+                                            pgoff_t start, struct page **pg)
+{
+#ifdef HAVE_FILEMAP_GET_FOLIOS_CONTIG
+       struct folio_batch fbatch;
+       int nr;
+
+       folio_batch_init(&fbatch);
+       *pg = NULL;
+
+       nr = filemap_get_folios_contig(mapping, &start, start, &fbatch);
+       if (nr == PAGEVEC_SIZE) {
+               --nr;
+               *pg = folio_page(fbatch.folios[nr], 0);
+               return 1;
+       }
+       return 0;
+#else /* !HAVE_FILEMAP_GET_FOLIOS_CONTIG */
+       return find_get_pages_contig(mapping, start, 1, pg);
+#endif
+}
+
 static struct page *vvp_pgcache_current(struct vvp_seq_private *priv)
 {
        struct lu_device *dev = &priv->vsp_sbi->ll_cl->cd_lu_dev;
@@ -416,8 +438,9 @@ static struct page *vvp_pgcache_current(struct vvp_seq_private *priv)
                }
 
                inode = vvp_object_inode(priv->vsp_clob);
-               nr = find_get_pages_contig(inode->i_mapping,
-                                          priv->vsp_page_index, 1, &vmpage);
+               nr = ll_filemap_get_one_page_contig(inode->i_mapping,
+                                                   priv->vsp_page_index,
+                                                   &vmpage);
                if (nr > 0) {
                        priv->vsp_page_index = vmpage->index;
                        break;
index e6d3634..13d8531 100644 (file)
@@ -2249,7 +2249,7 @@ static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        ctxt->loc_dir = o;
        llog_ctxt_put(ctxt);
 
-       llog_test_rand = prandom_u32();
+       llog_test_rand = get_random_u32();
 
        rc = llog_run_tests(&env, tgt);
        if (rc)
index 3a07035..c581211 100644 (file)
@@ -1135,7 +1135,7 @@ int lu_site_init(struct lu_site *s, struct lu_device *top)
                return -ENOMEM;
        }
 
-       s->ls_bkt_seed = prandom_u32();
+       s->ls_bkt_seed = get_random_u32();
        s->ls_bkt_cnt = max_t(long, 1 << LU_SITE_BKT_BITS,
                              2 * num_possible_cpus());
        s->ls_bkt_cnt = roundup_pow_of_two(s->ls_bkt_cnt);
index 1effd99..02476e0 100644 (file)
@@ -57,7 +57,9 @@ u64 lu_prandom_u64_max(u64 ep_ro)
        u64 rand = 0;
 
        if (ep_ro) {
-#if BITS_PER_LONG == 32
+#ifdef HAVE_GET_RANDOM_U32_AND_U64
+               rand = get_random_u64() % ep_ro;
+#elif BITS_PER_LONG == 32
                /*
                 * If ep_ro > 32-bit, first generate the high
                 * 32 bits of the random number, then add in the low
@@ -69,9 +71,9 @@ u64 lu_prandom_u64_max(u64 ep_ro)
                if (rand == (ep_ro & 0xffffffff00000000ULL))
                        rand |= prandom_u32_max((u32)ep_ro);
                else
-                       rand |= prandom_u32();
+                       rand |= get_random_u32();
 #else
-               rand = ((u64)prandom_u32() << 32 | prandom_u32()) % ep_ro;
+               rand = ((u64)get_random_u32() << 32 | get_random_u32()) % ep_ro;
 #endif
        }
 
index d14b223..97a9a53 100644 (file)
@@ -950,7 +950,7 @@ struct osd_check_lmv_buf {
  * \retval     -ve for failure
  */
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_stripe_dir_filldir(struct dir_context *buf,
+static FILLDIR_TYPE do_osd_stripe_dir_filldir(struct dir_context *buf,
 #else
 static int osd_stripe_dir_filldir(void *buf,
 #endif
@@ -990,6 +990,8 @@ static int osd_stripe_dir_filldir(void *buf,
        return 1;
 }
 
+WRAP_FILLDIR_FN(do_, osd_stripe_dir_filldir)
+
 /*
  * When lookup item under striped directory, we need to locate the master
  * MDT-object of the striped directory firstly, then the client will send
@@ -6955,7 +6957,7 @@ struct osd_filldir_cbs {
  * \retval 1 on buffer full
  */
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ldiskfs_filldir(struct dir_context *ctx,
+static FILLDIR_TYPE do_osd_ldiskfs_filldir(struct dir_context *ctx,
 #else
 static int osd_ldiskfs_filldir(void *ctx,
 #endif
@@ -7027,6 +7029,8 @@ static int osd_ldiskfs_filldir(void *ctx,
        RETURN(0);
 }
 
+WRAP_FILLDIR_FN(do_, osd_ldiskfs_filldir)
+
 /**
  * Calls ->iterate*() to load a directory entry at a time
  * and stored it in iterator's in-memory data structure.
index 96de28d..f7b164e 100644 (file)
@@ -1701,6 +1701,24 @@ static inline const char *blk_integrity_name(struct blk_integrity *bi)
 #define INTEGRITY_FLAG_WRITE BLK_INTEGRITY_GENERATE
 #endif
 
+#ifdef HAVE_FILLDIR_USE_CTX_RETURN_BOOL
+#define WRAP_FILLDIR_FN(prefix, fill_fn) \
+static bool fill_fn(struct dir_context *buf, const char *name, int namelen, \
+                   loff_t offset, __u64 ino, unsigned int d_type)          \
+{                                                                          \
+       return !prefix##fill_fn(buf, name, namelen, offset, ino, d_type);   \
+}
+#elif defined(HAVE_FILLDIR_USE_CTX)
+#define WRAP_FILLDIR_FN(prefix, fill_fn) \
+static int fill_fn(struct dir_context *buf, const char *name, int namelen,  \
+                  loff_t offset, __u64 ino, unsigned int d_type)           \
+{                                                                          \
+       return prefix##fill_fn(buf, name, namelen, offset, ino, d_type);    \
+}
+#else
+#define WRAP_FILLDIR_FN(prefix, fill_fn)
+#endif
+
 static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
 {
 #if IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)
index ffe4a0b..f589fe0 100644 (file)
@@ -1234,27 +1234,30 @@ typedef int (*scandir_t)(struct osd_thread_info *, struct osd_device *,
                         struct dentry *, filldir_t filldir);
 
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ios_varfid_fill(struct dir_context *buf, const char *name,
-                              int namelen, loff_t offset, __u64 ino,
-                              unsigned d_type);
-static int osd_ios_lf_fill(struct dir_context *buf, const char *name,
-                          int namelen, loff_t offset, __u64 ino,
-                          unsigned d_type);
-static int osd_ios_dl_fill(struct dir_context *buf, const char *name,
-                          int namelen, loff_t offset, __u64 ino,
-                          unsigned d_type);
-static int osd_ios_uld_fill(struct dir_context *buf, const char *name,
-                           int namelen, loff_t offset, __u64 ino,
-                           unsigned d_type);
+static FILLDIR_TYPE
+osd_ios_varfid_fill(struct dir_context *buf, const char *name, int namelen,
+                   loff_t offset, __u64 ino, unsigned int d_type);
+
+static FILLDIR_TYPE
+osd_ios_lf_fill(struct dir_context *buf, const char *name, int namelen,
+               loff_t offset, __u64 ino, unsigned int d_type);
+
+static FILLDIR_TYPE
+osd_ios_dl_fill(struct dir_context *buf, const char *name, int namelen,
+               loff_t offset, __u64 ino, unsigned int d_type);
+
+static FILLDIR_TYPE
+osd_ios_uld_fill(struct dir_context *buf, const char *name, int namelen,
+                loff_t offset, __u64 ino, unsigned int d_type);
 #else
 static int osd_ios_varfid_fill(void *buf, const char *name, int namelen,
-                              loff_t offset, __u64 ino, unsigned d_type);
+                              loff_t offset, __u64 ino, unsigned int d_type);
 static int osd_ios_lf_fill(void *buf, const char *name, int namelen,
-                          loff_t offset, __u64 ino, unsigned d_type);
+                          loff_t offset, __u64 ino, unsigned int d_type);
 static int osd_ios_dl_fill(void *buf, const char *name, int namelen,
-                          loff_t offset, __u64 ino, unsigned d_type);
+                          loff_t offset, __u64 ino, unsigned int d_type);
 static int osd_ios_uld_fill(void *buf, const char *name, int namelen,
-                           loff_t offset, __u64 ino, unsigned d_type);
+                           loff_t offset, __u64 ino, unsigned int d_type);
 #endif
 
 static int
@@ -1883,12 +1886,12 @@ osd_ios_scan_one(struct osd_thread_info *info, struct osd_device *dev,
  * or filter_fid_18_23), move them back to its proper /O/<seq>/d<x>.
  */
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ios_lf_fill(struct dir_context *buf,
+static FILLDIR_TYPE do_osd_ios_lf_fill(struct dir_context *buf,
 #else
 static int osd_ios_lf_fill(void *buf,
 #endif
                           const char *name, int namelen,
-                          loff_t offset, __u64 ino, unsigned d_type)
+                          loff_t offset, __u64 ino, unsigned int d_type)
 {
        struct osd_ios_filldir_buf *fill_buf =
                (struct osd_ios_filldir_buf *)buf;
@@ -1963,14 +1966,15 @@ put:
        /* skip the failure to make the scanning to continue. */
        return 0;
 }
+WRAP_FILLDIR_FN(do_, osd_ios_lf_fill)
 
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ios_varfid_fill(struct dir_context *buf,
+static FILLDIR_TYPE do_osd_ios_varfid_fill(struct dir_context *buf,
 #else
 static int osd_ios_varfid_fill(void *buf,
 #endif
                               const char *name, int namelen,
-                              loff_t offset, __u64 ino, unsigned d_type)
+                              loff_t offset, __u64 ino, unsigned int d_type)
 {
        struct osd_ios_filldir_buf *fill_buf =
                (struct osd_ios_filldir_buf *)buf;
@@ -1999,14 +2003,15 @@ static int osd_ios_varfid_fill(void *buf,
 
        RETURN(rc);
 }
+WRAP_FILLDIR_FN(do_, osd_ios_varfid_fill)
 
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ios_dl_fill(struct dir_context *buf,
+static FILLDIR_TYPE do_osd_ios_dl_fill(struct dir_context *buf,
 #else
 static int osd_ios_dl_fill(void *buf,
 #endif
                           const char *name, int namelen,
-                          loff_t offset, __u64 ino, unsigned d_type)
+                          loff_t offset, __u64 ino, unsigned int d_type)
 {
        struct osd_ios_filldir_buf *fill_buf =
                (struct osd_ios_filldir_buf *)buf;
@@ -2044,14 +2049,15 @@ static int osd_ios_dl_fill(void *buf,
 
        RETURN(rc);
 }
+WRAP_FILLDIR_FN(do_, osd_ios_dl_fill)
 
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ios_uld_fill(struct dir_context *buf,
+static FILLDIR_TYPE do_osd_ios_uld_fill(struct dir_context *buf,
 #else
 static int osd_ios_uld_fill(void *buf,
 #endif
                            const char *name, int namelen,
-                           loff_t offset, __u64 ino, unsigned d_type)
+                           loff_t offset, __u64 ino, unsigned int d_type)
 {
        struct osd_ios_filldir_buf *fill_buf =
                (struct osd_ios_filldir_buf *)buf;
@@ -2083,14 +2089,15 @@ static int osd_ios_uld_fill(void *buf,
 
        RETURN(rc);
 }
+WRAP_FILLDIR_FN(do_, osd_ios_uld_fill)
 
 #ifdef HAVE_FILLDIR_USE_CTX
-static int osd_ios_root_fill(struct dir_context *buf,
+static FILLDIR_TYPE do_osd_ios_root_fill(struct dir_context *buf,
 #else
 static int osd_ios_root_fill(void *buf,
 #endif
                             const char *name, int namelen,
-                            loff_t offset, __u64 ino, unsigned d_type)
+                            loff_t offset, __u64 ino, unsigned int d_type)
 {
        struct osd_ios_filldir_buf *fill_buf =
                (struct osd_ios_filldir_buf *)buf;
@@ -2136,6 +2143,8 @@ out_put:
        RETURN(rc);
 }
 
+WRAP_FILLDIR_FN(do_, osd_ios_root_fill)
+
 static int
 osd_ios_general_scan(struct osd_thread_info *info, struct osd_device *dev,
                     struct dentry *dentry, filldir_t filldir)