]> granicus.if.org Git - zfs/commitdiff
Linux does not HAVE_DNLC
authorMatthew Ahrens <mahrens@delphix.com>
Wed, 17 Oct 2018 17:30:08 +0000 (10:30 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 17 Oct 2018 17:30:08 +0000 (10:30 -0700)
Since Linux does not have the Directory Name Lookup Cache, we don't need
the code to manage it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #8031

Makefile.am
module/zfs/zfs_dir.c
module/zfs/zfs_vnops.c

index 782b88c2f4c4559fb09c0e7745885d26651c41e0..01ddc388c582ef2d9d0d1218a887457d81374687 100644 (file)
@@ -117,7 +117,7 @@ cppcheck:
                cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
                        --suppressions-list=.github/suppressions.txt \
                        -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
-                       -UHAVE_DNLC ${top_srcdir}; \
+                       ${top_srcdir}; \
        else \
                echo "skipping cppcheck because cppcheck is not installed"; \
        fi
index 8a591904f6ab857cdbdc337a5dfb0cb20cf7d87d..bd173e7c357c8a6ad53463ad2d2a5ddf95620af2 100644 (file)
@@ -99,11 +99,6 @@ zfs_match_find(zfsvfs_t *zfsvfs, znode_t *dzp, char *name, matchtype_t mt,
 
        *zoid = ZFS_DIRENT_OBJ(*zoid);
 
-#ifdef HAVE_DNLC
-       if (error == ENOENT && update)
-               dnlc_update(ZTOI(dzp), name, DNLC_NO_VNODE);
-#endif /* HAVE_DNLC */
-
        return (error);
 }
 
@@ -151,9 +146,6 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp,
        boolean_t       update;
        matchtype_t     mt = 0;
        uint64_t        zoid;
-#ifdef HAVE_DNLC
-       vnode_t         *vp = NULL;
-#endif /* HAVE_DNLC */
        int             error = 0;
        int             cmpflags;
 
@@ -320,29 +312,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp,
                if (error == 0)
                        error = (zoid == 0 ? SET_ERROR(ENOENT) : 0);
        } else {
-#ifdef HAVE_DNLC
-               if (update)
-                       vp = dnlc_lookup(ZTOI(dzp), name);
-               if (vp == DNLC_NO_VNODE) {
-                       iput(vp);
-                       error = SET_ERROR(ENOENT);
-               } else if (vp) {
-                       if (flag & ZNEW) {
-                               zfs_dirent_unlock(dl);
-                               iput(vp);
-                               return (SET_ERROR(EEXIST));
-                       }
-                       *dlpp = dl;
-                       *zpp = VTOZ(vp);
-                       return (0);
-               } else {
-                       error = zfs_match_find(zfsvfs, dzp, name, mt,
-                           update, direntflags, realpnp, &zoid);
-               }
-#else
                error = zfs_match_find(zfsvfs, dzp, name, mt,
                    update, direntflags, realpnp, &zoid);
-#endif /* HAVE_DNLC */
        }
        if (error) {
                if (error != ENOENT || (flag & ZEXISTS)) {
@@ -359,10 +330,6 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp,
                        zfs_dirent_unlock(dl);
                        return (error);
                }
-#ifdef HAVE_DNLC
-               if (!(flag & ZXATTR) && update)
-                       dnlc_update(ZTOI(dzp), name, ZTOI(*zpp));
-#endif /* HAVE_DNLC */
        }
 
        *dlpp = dl;
@@ -901,10 +868,6 @@ zfs_link_destroy(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag,
        int count = 0;
        int error;
 
-#ifdef HAVE_DNLC
-       dnlc_remove(ZTOI(dzp), dl->dl_name);
-#endif /* HAVE_DNLC */
-
        if (!(flag & ZRENAMING)) {
                mutex_enter(&zp->z_lock);
 
index f4e650dee30e90ec8204d45547c0c24ff1ad801e..863adc5950346ffb2e7d85cba72c6ed82748197c 100644 (file)
@@ -1208,27 +1208,6 @@ zfs_lookup(struct inode *dip, char *nm, struct inode **ipp, int flags,
                                return (0);
                        }
                        return (error);
-#ifdef HAVE_DNLC
-               } else if (!zdp->z_zfsvfs->z_norm &&
-                   (zdp->z_zfsvfs->z_case == ZFS_CASE_SENSITIVE)) {
-
-                       vnode_t *tvp = dnlc_lookup(dvp, nm);
-
-                       if (tvp) {
-                               error = zfs_fastaccesschk_execute(zdp, cr);
-                               if (error) {
-                                       iput(tvp);
-                                       return (error);
-                               }
-                               if (tvp == DNLC_NO_VNODE) {
-                                       iput(tvp);
-                                       return (SET_ERROR(ENOENT));
-                               } else {
-                                       *vpp = tvp;
-                                       return (specvp_check(vpp, cr));
-                               }
-                       }
-#endif /* HAVE_DNLC */
                }
        }
 
@@ -1765,13 +1744,6 @@ top:
                goto out;
        }
 
-#ifdef HAVE_DNLC
-       if (realnmp)
-               dnlc_remove(dvp, realnmp->pn_buf);
-       else
-               dnlc_remove(dvp, name);
-#endif /* HAVE_DNLC */
-
        mutex_enter(&zp->z_lock);
        may_delete_now = atomic_read(&ip->i_count) == 1 && !(zp->z_is_mapped);
        mutex_exit(&zp->z_lock);