mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
config: remove HAVE_VFS_ITERATE/HAVE_VFS_ITERATE_SHARED
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
@@ -55,7 +55,7 @@ extern int zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap,
|
||||
znode_t **zpp, cred_t *cr, int flags, vsecattr_t *vsecp, zidmap_t *mnt_ns);
|
||||
extern int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd,
|
||||
cred_t *cr, int flags);
|
||||
extern int zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr);
|
||||
extern int zfs_readdir(struct inode *ip, struct dir_context *ctx, cred_t *cr);
|
||||
#ifdef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK
|
||||
extern int zfs_getattr_fast(zidmap_t *, u32 request_mask, struct inode *ip,
|
||||
struct kstat *sp);
|
||||
|
||||
@@ -111,73 +111,6 @@ extern const struct inode_operations zpl_ops_snapdir;
|
||||
extern const struct file_operations zpl_fops_shares;
|
||||
extern const struct inode_operations zpl_ops_shares;
|
||||
|
||||
#if defined(HAVE_VFS_ITERATE) || defined(HAVE_VFS_ITERATE_SHARED)
|
||||
|
||||
#define ZPL_DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
|
||||
.actor = _actor, \
|
||||
.pos = _pos, \
|
||||
}
|
||||
|
||||
typedef struct dir_context zpl_dir_context_t;
|
||||
|
||||
#define zpl_dir_emit dir_emit
|
||||
#define zpl_dir_emit_dot dir_emit_dot
|
||||
#define zpl_dir_emit_dotdot dir_emit_dotdot
|
||||
#define zpl_dir_emit_dots dir_emit_dots
|
||||
|
||||
#else
|
||||
|
||||
typedef struct zpl_dir_context {
|
||||
void *dirent;
|
||||
const filldir_t actor;
|
||||
loff_t pos;
|
||||
} zpl_dir_context_t;
|
||||
|
||||
#define ZPL_DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
|
||||
.dirent = _dirent, \
|
||||
.actor = _actor, \
|
||||
.pos = _pos, \
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit(zpl_dir_context_t *ctx, const char *name, int namelen,
|
||||
uint64_t ino, unsigned type)
|
||||
{
|
||||
return (!ctx->actor(ctx->dirent, name, namelen, ctx->pos, ino, type));
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit_dot(struct file *file, zpl_dir_context_t *ctx)
|
||||
{
|
||||
return (ctx->actor(ctx->dirent, ".", 1, ctx->pos,
|
||||
file_inode(file)->i_ino, DT_DIR) == 0);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit_dotdot(struct file *file, zpl_dir_context_t *ctx)
|
||||
{
|
||||
return (ctx->actor(ctx->dirent, "..", 2, ctx->pos,
|
||||
parent_ino(file_dentry(file)), DT_DIR) == 0);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit_dots(struct file *file, zpl_dir_context_t *ctx)
|
||||
{
|
||||
if (ctx->pos == 0) {
|
||||
if (!zpl_dir_emit_dot(file, ctx))
|
||||
return (false);
|
||||
ctx->pos = 1;
|
||||
}
|
||||
if (ctx->pos == 1) {
|
||||
if (!zpl_dir_emit_dotdot(file, ctx))
|
||||
return (false);
|
||||
ctx->pos = 2;
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
#endif /* HAVE_VFS_ITERATE */
|
||||
|
||||
|
||||
/* zpl_file_range.c */
|
||||
|
||||
/* handlers for file_operations of the same name */
|
||||
|
||||
Reference in New Issue
Block a user