Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfsserver/nfs_nfsdport.c
Show First 20 Lines • Show All 2,014 Lines • ▼ Show 20 Lines | if (nd->nd_repstat != 0) { | ||||
free(cookies, M_TEMP); | free(cookies, M_TEMP); | ||||
free(rbuf, M_TEMP); | free(rbuf, M_TEMP); | ||||
if (nd->nd_flag & ND_NFSV3) | if (nd->nd_flag & ND_NFSV3) | ||||
nfsrv_postopattr(nd, getret, &at); | nfsrv_postopattr(nd, getret, &at); | ||||
goto out; | goto out; | ||||
} | } | ||||
/* | /* | ||||
* For now ZFS requires VOP_LOOKUP as a workaround. Until ino_t is changed | * Check to see if entries in this directory can be safely acquired | ||||
* to 64 bit type a ZFS filesystem with over 1 billion files in it | * via VFS_VGET() or if a switch to VOP_LOOKUP() is required. | ||||
* will suffer from 64bit -> 32bit truncation. | * ZFS snapshot directories need VOP_LOOKUP(), so that any | ||||
* automount of the snapshot directory that is required will | |||||
* be done. | |||||
* This needs to be done here for NFSv4, since NFSv4 never does | |||||
* a VFS_VGET() for "." or "..". | |||||
*/ | */ | ||||
if (is_zfs == 1) | if (is_zfs == 1) { | ||||
r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp); | |||||
if (r == EOPNOTSUPP) { | |||||
usevget = 0; | usevget = 0; | ||||
cn.cn_nameiop = LOOKUP; | cn.cn_nameiop = LOOKUP; | ||||
cn.cn_lkflags = LK_SHARED | LK_RETRY; | cn.cn_lkflags = LK_SHARED | LK_RETRY; | ||||
cn.cn_cred = nd->nd_cred; | cn.cn_cred = nd->nd_cred; | ||||
cn.cn_thread = p; | cn.cn_thread = p; | ||||
} else if (r == 0) | |||||
vput(nvp); | |||||
} | |||||
/* | /* | ||||
* Save this position, in case there is an error before one entry | * Save this position, in case there is an error before one entry | ||||
* is created. | * is created. | ||||
*/ | */ | ||||
mb0 = nd->nd_mb; | mb0 = nd->nd_mb; | ||||
bpos0 = nd->nd_bpos; | bpos0 = nd->nd_bpos; | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if (dp->d_fileno != 0 && dp->d_type != DT_WHT && | ||||
vp, dp->d_fileno); | vp, dp->d_fileno); | ||||
if (refp == NULL) { | if (refp == NULL) { | ||||
if (usevget) | if (usevget) | ||||
r = VFS_VGET(mp, dp->d_fileno, | r = VFS_VGET(mp, dp->d_fileno, | ||||
LK_SHARED, &nvp); | LK_SHARED, &nvp); | ||||
else | else | ||||
r = EOPNOTSUPP; | r = EOPNOTSUPP; | ||||
if (r == EOPNOTSUPP) { | if (r == EOPNOTSUPP) { | ||||
if (usevget) { | |||||
usevget = 0; | usevget = 0; | ||||
cn.cn_nameiop = LOOKUP; | |||||
cn.cn_lkflags = | |||||
LK_SHARED | | |||||
LK_RETRY; | |||||
cn.cn_cred = | |||||
nd->nd_cred; | |||||
cn.cn_thread = p; | |||||
} | |||||
cn.cn_nameptr = dp->d_name; | cn.cn_nameptr = dp->d_name; | ||||
cn.cn_namelen = nlen; | cn.cn_namelen = nlen; | ||||
cn.cn_flags = ISLASTCN | | cn.cn_flags = ISLASTCN | | ||||
NOFOLLOW | LOCKLEAF; | NOFOLLOW | LOCKLEAF; | ||||
if (nlen == 2 && | if (nlen == 2 && | ||||
dp->d_name[0] == '.' && | dp->d_name[0] == '.' && | ||||
dp->d_name[1] == '.') | dp->d_name[1] == '.') | ||||
cn.cn_flags |= | cn.cn_flags |= | ||||
▲ Show 20 Lines • Show All 1,314 Lines • Show Last 20 Lines |