Whamcloud - gitweb
LU-16351 llite: Linux 6.1 prandom, folios_contig, vma_iterator
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_internal.h
index e694e7b..e2f03ec 100644 (file)
@@ -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 */