mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-09 04:36:31 +00:00
nfscl: Add a check for VREG for delegations
Since delegations are only issued for regular files, check v_type to see if the query is for a regular file. This is a simple optimization for the non-VREG case. While here, fix a couple of global variable declarations. This patch should only affect the NFSv4.1/4.2 behaviour when delegations are enabled, which is not the default. MFC after: 1 month
This commit is contained in:
parent
ec1f285f2e
commit
4308d6e0fc
|
@ -93,9 +93,8 @@ NFSREQSPINLOCK;
|
|||
NFSCLSTATEMUTEX;
|
||||
int nfscl_inited = 0;
|
||||
struct nfsclhead nfsclhead; /* Head of clientid list */
|
||||
int nfscl_deleghighwater = NFSCLDELEGHIGHWATER;
|
||||
int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER;
|
||||
|
||||
static int nfscl_deleghighwater = NFSCLDELEGHIGHWATER;
|
||||
static int nfscl_delegcnt = 0;
|
||||
static int nfscl_layoutcnt = 0;
|
||||
static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *,
|
||||
|
@ -4647,7 +4646,7 @@ nfscl_mustflush(vnode_t vp)
|
|||
|
||||
np = VTONFS(vp);
|
||||
nmp = VFSTONFS(vp->v_mount);
|
||||
if (!NFSHASNFSV4(nmp))
|
||||
if (!NFSHASNFSV4(nmp) || vp->v_type != VREG)
|
||||
return (1);
|
||||
NFSLOCKMNT(nmp);
|
||||
if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) {
|
||||
|
@ -4687,7 +4686,7 @@ nfscl_nodeleg(vnode_t vp, int writedeleg)
|
|||
|
||||
np = VTONFS(vp);
|
||||
nmp = VFSTONFS(vp->v_mount);
|
||||
if (!NFSHASNFSV4(nmp))
|
||||
if (!NFSHASNFSV4(nmp) || vp->v_type != VREG)
|
||||
return (1);
|
||||
NFSLOCKMNT(nmp);
|
||||
if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user