FreeBSD: Cleanup dead code from VFS

The vfs_*_feature() macros turn anything that uses them into dead code,
so we can delete all of it.

As a side effect, zfs_set_fuid_feature() is now identical in
module/os/freebsd/zfs/zfs_vnops_os.c and
module/os/linux/zfs/zfs_vnops_os.c. A few other functions are identical
too. Future cleanup could move these into a common file.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13832
This commit is contained in:
Richard Yao 2022-09-02 16:20:10 -04:00 committed by GitHub
parent 58e8054bce
commit 0b30dc484f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 53 deletions

View File

@ -117,9 +117,5 @@ typedef uint64_t vfs_feature_t;
#define VFSFT_ZEROCOPY_SUPPORTED 0x100000200 #define VFSFT_ZEROCOPY_SUPPORTED 0x100000200
/* Support loaning /returning cache buffer */ /* Support loaning /returning cache buffer */
#define vfs_set_feature(vfsp, feature) do { } while (0)
#define vfs_clear_feature(vfsp, feature) do { } while (0)
#define vfs_has_feature(vfsp, feature) (0)
#include <sys/mount.h> #include <sys/mount.h>
#endif /* _OPENSOLARIS_SYS_VFS_H_ */ #endif /* _OPENSOLARIS_SYS_VFS_H_ */

View File

@ -1151,23 +1151,6 @@ static void
zfs_set_fuid_feature(zfsvfs_t *zfsvfs) zfs_set_fuid_feature(zfsvfs_t *zfsvfs)
{ {
zfsvfs->z_use_fuids = USE_FUIDS(zfsvfs->z_version, zfsvfs->z_os); zfsvfs->z_use_fuids = USE_FUIDS(zfsvfs->z_version, zfsvfs->z_os);
if (zfsvfs->z_vfs) {
if (zfsvfs->z_use_fuids) {
vfs_set_feature(zfsvfs->z_vfs, VFSFT_XVATTR);
vfs_set_feature(zfsvfs->z_vfs, VFSFT_SYSATTR_VIEWS);
vfs_set_feature(zfsvfs->z_vfs, VFSFT_ACEMASKONACCESS);
vfs_set_feature(zfsvfs->z_vfs, VFSFT_ACLONCREATE);
vfs_set_feature(zfsvfs->z_vfs, VFSFT_ACCESS_FILTER);
vfs_set_feature(zfsvfs->z_vfs, VFSFT_REPARSE);
} else {
vfs_clear_feature(zfsvfs->z_vfs, VFSFT_XVATTR);
vfs_clear_feature(zfsvfs->z_vfs, VFSFT_SYSATTR_VIEWS);
vfs_clear_feature(zfsvfs->z_vfs, VFSFT_ACEMASKONACCESS);
vfs_clear_feature(zfsvfs->z_vfs, VFSFT_ACLONCREATE);
vfs_clear_feature(zfsvfs->z_vfs, VFSFT_ACCESS_FILTER);
vfs_clear_feature(zfsvfs->z_vfs, VFSFT_REPARSE);
}
}
zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os); zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os);
} }
@ -1226,15 +1209,6 @@ zfs_domount(vfs_t *vfsp, char *osname)
* Set features for file system. * Set features for file system.
*/ */
zfs_set_fuid_feature(zfsvfs); zfs_set_fuid_feature(zfsvfs);
if (zfsvfs->z_case == ZFS_CASE_INSENSITIVE) {
vfs_set_feature(vfsp, VFSFT_DIRENTFLAGS);
vfs_set_feature(vfsp, VFSFT_CASEINSENSITIVE);
vfs_set_feature(vfsp, VFSFT_NOCASESENSITIVE);
} else if (zfsvfs->z_case == ZFS_CASE_MIXED) {
vfs_set_feature(vfsp, VFSFT_DIRENTFLAGS);
vfs_set_feature(vfsp, VFSFT_CASEINSENSITIVE);
}
vfs_set_feature(vfsp, VFSFT_ZEROCOPY_SUPPORTED);
if (dmu_objset_is_snapshot(zfsvfs->z_os)) { if (dmu_objset_is_snapshot(zfsvfs->z_os)) {
uint64_t pval; uint64_t pval;

View File

@ -1672,7 +1672,6 @@ zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp,
int outcount; int outcount;
int error; int error;
uint8_t prefetch; uint8_t prefetch;
boolean_t check_sysattrs;
uint8_t type; uint8_t type;
int ncooks; int ncooks;
cookie_t *cooks = NULL; cookie_t *cooks = NULL;
@ -1756,19 +1755,6 @@ zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp,
*cookies = cooks; *cookies = cooks;
*ncookies = ncooks; *ncookies = ncooks;
} }
/*
* If this VFS supports the system attribute view interface; and
* we're looking at an extended attribute directory; and we care
* about normalization conflicts on this vfs; then we must check
* for normalization conflicts with the sysattr name space.
*/
#ifdef TODO
check_sysattrs = vfs_has_feature(vp->v_vfsp, VFSFT_SYSATTR_VIEWS) &&
(vp->v_flag & V_XATTRDIR) && zfsvfs->z_norm &&
(flags & V_RDDIR_ENTFLAGS);
#else
check_sysattrs = 0;
#endif
/* /*
* Transform to file-system independent format * Transform to file-system independent format
@ -1824,15 +1810,6 @@ zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp,
* uint8_t type = ZFS_DIRENT_TYPE(zap.za_first_integer); * uint8_t type = ZFS_DIRENT_TYPE(zap.za_first_integer);
*/ */
type = ZFS_DIRENT_TYPE(zap.za_first_integer); type = ZFS_DIRENT_TYPE(zap.za_first_integer);
if (check_sysattrs && !zap.za_normalization_conflict) {
#ifdef TODO
zap.za_normalization_conflict =
xattr_sysattr_casechk(zap.za_name);
#else
panic("%s:%u: TODO", __func__, __LINE__);
#endif
}
} }
if (flags & V_RDDIR_ACCFILTER) { if (flags & V_RDDIR_ACCFILTER) {