How is a dcache for an exported directory on NFSD prevented from dropping?

Viewed 43

gurus!

I'm studying NFS code in Linux Kernel of CentOS7.

And I would like to know how to prevent a dcache for an exported directory on NFSD from dropping. If the dcache is dropped and recreated, the hash key for a sunrpc cache for the exported directory is changed and can't access the sunrpc cache, since the hash key is based on the address of dcache.

snip from fs/export.c

static int
svc_export_hash(struct svc_export *exp)
{
    int hash;

    hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS);
    hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS);
    hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS);
    return hash;
}

If you point out the concrete code using ext2 etc, it is very helpful for me. I appreciate you in advance.

Best regards.

0 Answers
Related