Home | History | Annotate | Download | only in nfs

Lines Matching defs:ndp

1210 nfs_unlinkdircache(struct nfsnode *np, struct nfsdircache *ndp)
1214 KASSERT(ndp != &dzero);
1216 if (LIST_NEXT(ndp, dc_hash) == (void *)-1)
1219 TAILQ_REMOVE(&np->n_dirchain, ndp, dc_chain);
1220 LIST_REMOVE(ndp, dc_hash);
1221 LIST_NEXT(ndp, dc_hash) = (void *)-1; /* mark as unlinked */
1223 nfs_putdircache_unlocked(np, ndp);
1227 nfs_putdircache(struct nfsnode *np, struct nfsdircache *ndp)
1231 if (ndp == &dzero)
1234 KASSERT(ndp->dc_refcnt > 0);
1236 ref = --ndp->dc_refcnt;
1240 kmem_free(ndp, sizeof(*ndp));
1244 nfs_putdircache_unlocked(struct nfsnode *np, struct nfsdircache *ndp)
1250 if (ndp == &dzero)
1253 KASSERT(ndp->dc_refcnt > 0);
1254 ref = --ndp->dc_refcnt;
1256 kmem_free(ndp, sizeof(*ndp));
1263 struct nfsdircache *ndp = NULL;
1295 LIST_FOREACH(ndp, ndhp, dc_hash) {
1296 if (ndp->dc_cookie32 == (u_int32_t)off) {
1302 if (ndp->dc_flags & NFSDC_INVALID) {
1303 ndp->dc_blkcookie = ndp->dc_cookie;
1304 ndp->dc_entry = 0;
1305 ndp->dc_flags &= ~NFSDC_INVALID;
1311 LIST_FOREACH(ndp, ndhp, dc_hash) {
1312 if (ndp->dc_cookie == off)
1316 if (ndp != NULL)
1317 ndp->dc_refcnt++;
1319 return ndp;
1329 struct nfsdircache *ndp = NULL;
1354 ndp = nfs_searchdircache(vp, off, 0, &hashent);
1357 if (ndp && (ndp->dc_flags & NFSDC_INVALID) == 0) {
1362 if (ndp->dc_blkcookie == blkoff && ndp->dc_entry == en)
1364 nfs_unlinkdircache(np, ndp);
1365 nfs_putdircache_unlocked(np, ndp);
1366 ndp = NULL;
1371 if (!ndp) {
1379 ndp = newndp;
1393 ndp->dc_cookie32 = (hashent << 24) | (gen & 0xffffff);
1398 ndp->dc_cookie = off;
1399 ndp->dc_blkcookie = blkoff;
1400 ndp->dc_entry = en;
1401 ndp->dc_flags = 0;
1418 KASSERT(ndp->dc_refcnt == 1);
1419 LIST_INSERT_HEAD(ndhp, ndp, dc_hash);
1420 TAILQ_INSERT_TAIL(&np->n_dirchain, ndp, dc_chain);
1421 ndp->dc_refcnt++;
1423 KASSERT(ndp->dc_refcnt > 0);
1427 return ndp;
1434 struct nfsdircache *ndp = NULL;
1451 while ((ndp = TAILQ_FIRST(&np->n_dirchain)) != NULL) {
1452 KASSERT(!forcefree || ndp->dc_refcnt == 1);
1453 nfs_unlinkdircache(np, ndp);
1462 TAILQ_FOREACH(ndp, &np->n_dirchain, dc_chain)
1463 ndp->dc_flags |= NFSDC_INVALID;