From ca992899d55fd13e65b75ace02931daaa29c18bd Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Fri, 27 Jan 2023 00:54:42 -0600 Subject: [PATCH] LU-16351 llite: Linux 6.1 prandom, folios_contig, vma_iterator 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. Test-Parameters: trivial HPE-bug-id: LUS-11377 Signed-off-by: Shaun Tancheff Change-Id: I23dc23d0252e1995555b6685f5cf7c207edf642b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49232 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: xinliang Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger --- contrib/scripts/spelling.txt | 3 +- lustre/autoconf/lustre-core.m4 | 101 ++++++++++++++++++++++++++++++++++++++ lustre/llite/llite_mmap.c | 22 +++++++-- lustre/llite/llite_nfs.c | 51 +++++++++++++------ lustre/llite/vvp_dev.c | 27 +++++++++- lustre/obdclass/llog_test.c | 2 +- lustre/obdclass/lu_object.c | 2 +- lustre/obdclass/lu_tgt_descs.c | 8 +-- lustre/osd-ldiskfs/osd_handler.c | 8 ++- lustre/osd-ldiskfs/osd_internal.h | 18 +++++++ lustre/osd-ldiskfs/osd_scrub.c | 61 +++++++++++++---------- 11 files changed, 248 insertions(+), 55 deletions(-) diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt index 0e8ac15..26a1249 100644 --- a/contrib/scripts/spelling.txt +++ b/contrib/scripts/spelling.txt @@ -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 @@ -212,6 +212,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 diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 988ef71..7280e58 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -3526,6 +3526,97 @@ AC_DEFUN([LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2], [ ]) # LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2 # +# 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 + ],[ + 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 + ],[ + 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 + ],[ + 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([filldir_ctx_return_bool], [ + 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 @@ -3757,6 +3848,11 @@ AC_DEFUN([LC_PROG_LINUX_SRC], [ LC_SRC_HAVE_VFS_SETXATTR_NON_CONST_VALUE LC_SRC_HAVE_IOV_ITER_GET_PAGES_ALLOC2 + # 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 ]) @@ -4003,6 +4099,11 @@ AC_DEFUN([LC_PROG_LINUX_RESULTS], [ LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2 + # 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 ]) diff --git a/lustre/llite/llite_mmap.c b/lustre/llite/llite_mmap.c index 3d89701..48ecd21 100644 --- a/lustre/llite/llite_mmap.c +++ b/lustre/llite/llite_mmap.c @@ -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; diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index 744f4f9..5c16937 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -200,19 +200,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 @@ -234,11 +225,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 = { diff --git a/lustre/llite/vvp_dev.c b/lustre/llite/vvp_dev.c index 0a2fc5b..4036afc 100644 --- a/lustre/llite/vvp_dev.c +++ b/lustre/llite/vvp_dev.c @@ -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; diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index 1a7cbde..6b32d80 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -2325,7 +2325,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) diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index d2fbbd9..5389a86 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -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); diff --git a/lustre/obdclass/lu_tgt_descs.c b/lustre/obdclass/lu_tgt_descs.c index df0d115..9a965fc 100644 --- a/lustre/obdclass/lu_tgt_descs.c +++ b/lustre/obdclass/lu_tgt_descs.c @@ -56,7 +56,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 @@ -68,9 +70,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 } diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 0f0c4d2..8a82f6a 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -911,7 +911,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 @@ -951,6 +951,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 @@ -7039,7 +7041,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 @@ -7111,6 +7113,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. diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index e694e7b..e2f03ec 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -1749,4 +1749,22 @@ bool osd_tx_was_declared(const struct lu_env *env, struct osd_thandle *oth, #define osd_dquot_transfer(ns, i, a) dquot_transfer((i), (a)) #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 + #endif /* _OSD_INTERNAL_H */ diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index cf1b429..fa2c7d3 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -1360,27 +1360,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 @@ -2009,12 +2012,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//d. */ #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; @@ -2089,14 +2092,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; @@ -2125,14 +2129,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; @@ -2170,14 +2175,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; @@ -2209,14 +2215,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; @@ -2262,6 +2269,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) -- 1.8.3.1