mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 16:44:01 +08:00
vfs/nfs: Revert white space changes
This commit is contained in:
@@ -219,7 +219,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
|
||||
nconf = getnetconfigent("udp6");
|
||||
else
|
||||
nconf = getnetconfigent("tcp6");
|
||||
|
||||
|
||||
pktscale = nfs_bufpackets;
|
||||
if (pktscale < 2)
|
||||
pktscale = 2;
|
||||
@@ -237,7 +237,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
|
||||
*/
|
||||
so = NULL;
|
||||
saddr = NFSSOCKADDR(nrp->nr_nam, struct sockaddr *);
|
||||
error = socreate(saddr->sa_family, &so, nrp->nr_sotype,
|
||||
error = socreate(saddr->sa_family, &so, nrp->nr_sotype,
|
||||
nrp->nr_soproto, td->td_ucred, td);
|
||||
if (error) {
|
||||
td->td_ucred = origcred;
|
||||
@@ -391,7 +391,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
|
||||
/*
|
||||
* For UDP, there are 2 timeouts:
|
||||
* - CLSET_RETRY_TIMEOUT sets the initial timeout for the timer
|
||||
* that does a retransmit of an RPC request using the same
|
||||
* that does a retransmit of an RPC request using the same
|
||||
* socket and xid. This is what you normally want to do,
|
||||
* since NFS servers depend on "same xid" for their
|
||||
* Duplicate Request Cache.
|
||||
@@ -741,7 +741,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
|
||||
if (dtrace_nfscl_nfs234_start_probe != NULL) {
|
||||
uint32_t probe_id;
|
||||
int probe_procnum;
|
||||
|
||||
|
||||
if (nd->nd_flag & ND_NFSV4) {
|
||||
probe_id =
|
||||
nfscl_nfs4_start_probes[nd->nd_procnum];
|
||||
@@ -1143,9 +1143,9 @@ tryagain:
|
||||
j != NFSERR_STALESTATEID &&
|
||||
j != NFSERR_BADSTATEID &&
|
||||
j != NFSERR_BADSEQID &&
|
||||
j != NFSERR_BADXDR &&
|
||||
j != NFSERR_BADXDR &&
|
||||
j != NFSERR_RESOURCE &&
|
||||
j != NFSERR_NOFILEHANDLE)))
|
||||
j != NFSERR_NOFILEHANDLE)))
|
||||
nd->nd_flag |= ND_INCRSEQID;
|
||||
}
|
||||
/*
|
||||
@@ -1264,13 +1264,13 @@ static int
|
||||
nfs_sig_pending(sigset_t set)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0 ; i < nitems(newnfs_sig_set); i++)
|
||||
if (SIGISMEMBER(set, newnfs_sig_set[i]))
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The set/restore sigmask functions are used to (temporarily) overwrite
|
||||
* the thread td_sigmask during an RPC call (for example). These are also
|
||||
@@ -1283,7 +1283,7 @@ newnfs_set_sigmask(struct thread *td, sigset_t *oldset)
|
||||
sigset_t newset;
|
||||
int i;
|
||||
struct proc *p;
|
||||
|
||||
|
||||
SIGFILLSET(newset);
|
||||
if (td == NULL)
|
||||
td = curthread; /* XXX */
|
||||
@@ -1349,7 +1349,7 @@ newnfs_sigintr(struct nfsmount *nmp, struct thread *td)
|
||||
#ifndef __rtems__
|
||||
struct proc *p;
|
||||
sigset_t tmpset;
|
||||
|
||||
|
||||
/* Terminate all requests while attempting a forced unmount. */
|
||||
if (NFSCL_FORCEDISM(nmp->nm_mountp))
|
||||
return (EIO);
|
||||
@@ -1433,7 +1433,7 @@ nfs_up(struct nfsmount *nmp, struct thread *td, const char *msg,
|
||||
VQ_NOTRESP, 1);
|
||||
} else
|
||||
mtx_unlock(&nmp->nm_mtx);
|
||||
|
||||
|
||||
mtx_lock(&nmp->nm_mtx);
|
||||
if ((flags & NFSSTA_LOCKTIMEO) && (nmp->nm_state & NFSSTA_LOCKTIMEO)) {
|
||||
nmp->nm_state &= ~NFSSTA_LOCKTIMEO;
|
||||
@@ -1443,3 +1443,4 @@ nfs_up(struct nfsmount *nmp, struct thread *td, const char *msg,
|
||||
} else
|
||||
mtx_unlock(&nmp->nm_mtx);
|
||||
}
|
||||
|
||||
|
@@ -818,3 +818,4 @@ DECLARE_MODULE(nfscommon, nfscommon_mod, SI_SUB_VFS, SI_ORDER_ANY);
|
||||
MODULE_VERSION(nfscommon, 1);
|
||||
MODULE_DEPEND(nfscommon, nfssvc, 1, 1, 1);
|
||||
MODULE_DEPEND(nfscommon, krpc, 1, 1, 1);
|
||||
|
||||
|
@@ -4770,3 +4770,4 @@ nfsv4_findmirror(struct nfsmount *nmp)
|
||||
}
|
||||
return (ds);
|
||||
}
|
||||
|
||||
|
@@ -96,8 +96,7 @@ void ncl_doio_directwrite(struct buf *);
|
||||
int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *);
|
||||
int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *);
|
||||
int ncl_vinvalbuf(struct vnode *, int, struct thread *, int);
|
||||
int ncl_asyncio(struct
|
||||
nfsmount *, struct buf *, struct ucred *,
|
||||
int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *,
|
||||
struct thread *);
|
||||
int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *,
|
||||
int);
|
||||
|
@@ -1695,7 +1695,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
|
||||
PROC_UNLOCK(p);
|
||||
#else /* __rtems__ */
|
||||
panic("nfsclient: text file modification: want to killproc");
|
||||
#endif /* _-rtems__ */
|
||||
#endif /* __rtems__ */
|
||||
} else
|
||||
NFSUNLOCKNODE(np);
|
||||
}
|
||||
@@ -1923,3 +1923,4 @@ ncl_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize)
|
||||
}
|
||||
return(error);
|
||||
}
|
||||
|
||||
|
@@ -298,3 +298,4 @@ nfsrvd_cbinit(int terminating)
|
||||
NFSD_LOCK();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1452,3 +1452,4 @@ MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1);
|
||||
MODULE_DEPEND(nfscl, krpc, 1, 1, 1);
|
||||
MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1);
|
||||
MODULE_DEPEND(nfscl, nfslock, 1, 1, 1);
|
||||
|
||||
|
@@ -7740,3 +7740,4 @@ out:
|
||||
}
|
||||
return (laystat);
|
||||
}
|
||||
|
||||
|
@@ -5457,3 +5457,4 @@ tryagain:
|
||||
NFSUNLOCKCLSTATE();
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@@ -394,3 +394,4 @@ ncl_init(struct vfsconf *vfsp)
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@@ -2060,3 +2060,4 @@ void nfscl_retopts(struct nfsmount *nmp, char *buffer, size_t buflen)
|
||||
nfscl_printoptval(nmp, nmp->nm_timeo, ",timeout", &buf, &blen);
|
||||
nfscl_printoptval(nmp, nmp->nm_retry, ",retrans", &buf, &blen);
|
||||
}
|
||||
|
||||
|
@@ -817,7 +817,7 @@ nfs_close(struct vop_close_args *ap)
|
||||
int cm = newnfs_commit_on_close ? 1 : 0;
|
||||
error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0);
|
||||
/* np->n_flag &= ~NMODIFIED; */
|
||||
} else if (NFS_ISV4(vp)) {
|
||||
} else if (NFS_ISV4(vp)) {
|
||||
if (nfscl_mustflush(vp) != 0) {
|
||||
int cm = newnfs_commit_on_close ? 1 : 0;
|
||||
error = ncl_flush(vp, MNT_WAIT, ap->a_td,
|
||||
@@ -833,10 +833,10 @@ nfs_close(struct vop_close_args *ap)
|
||||
}
|
||||
NFSLOCKNODE(np);
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* Invalidate the attribute cache in all cases.
|
||||
* An open is going to fetch fresh attrs any way, other procs
|
||||
* on this node that have file open will be forced to do an
|
||||
* on this node that have file open will be forced to do an
|
||||
* otw attr fetch, but this is safe.
|
||||
* --> A user found that their RPC count dropped by 20% when
|
||||
* this was commented out and I can't see any requirement
|
||||
@@ -891,7 +891,7 @@ nfs_close(struct vop_close_args *ap)
|
||||
np->n_directio_asyncwr));
|
||||
if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) {
|
||||
NFSLOCKNODE(np);
|
||||
KASSERT((np->n_directio_opens > 0),
|
||||
KASSERT((np->n_directio_opens > 0),
|
||||
("nfs_close: unexpectedly value (0) of n_directio_opens\n"));
|
||||
np->n_directio_opens--;
|
||||
if (np->n_directio_opens == 0)
|
||||
@@ -1021,7 +1021,7 @@ nfs_setattr(struct vop_setattr_args *ap)
|
||||
vap->va_mode == (mode_t)VNOVAL &&
|
||||
vap->va_uid == (uid_t)VNOVAL &&
|
||||
vap->va_gid == (gid_t)VNOVAL)
|
||||
return (0);
|
||||
return (0);
|
||||
vap->va_size = VNOVAL;
|
||||
break;
|
||||
default:
|
||||
@@ -1072,7 +1072,7 @@ nfs_setattr(struct vop_setattr_args *ap)
|
||||
}
|
||||
} else {
|
||||
NFSLOCKNODE(np);
|
||||
if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) &&
|
||||
if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) &&
|
||||
(np->n_flag & NMODIFIED) && vp->v_type == VREG) {
|
||||
NFSUNLOCKNODE(np);
|
||||
error = ncl_vinvalbuf(vp, V_SAVE, td, 1);
|
||||
@@ -1146,7 +1146,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
||||
struct nfsvattr dnfsva, nfsva;
|
||||
struct vattr vattr;
|
||||
struct timespec nctime;
|
||||
|
||||
|
||||
*vpp = NULLVP;
|
||||
if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) &&
|
||||
(cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME))
|
||||
@@ -1223,7 +1223,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
||||
cache_purge(newvp);
|
||||
if (dvp != newvp)
|
||||
vput(newvp);
|
||||
else
|
||||
else
|
||||
vrele(newvp);
|
||||
*vpp = NULLVP;
|
||||
} else if (error == ENOENT) {
|
||||
@@ -1379,7 +1379,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
||||
(void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL,
|
||||
0, 1);
|
||||
else if ((flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) &&
|
||||
!(np->n_flag & NMODIFIED)) {
|
||||
!(np->n_flag & NMODIFIED)) {
|
||||
/*
|
||||
* Flush the attribute cache when opening a
|
||||
* leaf node to ensure that fresh attributes
|
||||
@@ -1711,7 +1711,7 @@ again:
|
||||
/* try again without setting uid/gid */
|
||||
vap->va_uid = (uid_t)VNOVAL;
|
||||
vap->va_gid = (uid_t)VNOVAL;
|
||||
error = nfsrpc_setattr(newvp, vap, NULL,
|
||||
error = nfsrpc_setattr(newvp, vap, NULL,
|
||||
cnp->cn_cred, cnp->cn_thread, &nfsva,
|
||||
&attrflag, NULL);
|
||||
}
|
||||
@@ -1899,7 +1899,7 @@ nfs_rename(struct vop_rename_args *ap)
|
||||
* under NFSV3. NFSV2 does not have this problem because
|
||||
* ( as far as I can tell ) it flushes dirty buffers more
|
||||
* often.
|
||||
*
|
||||
*
|
||||
* Skip the rename operation if the fsync fails, this can happen
|
||||
* due to the server's volume being full, when we pushed out data
|
||||
* that was written back to our cache earlier. Not checking for
|
||||
@@ -2311,10 +2311,10 @@ nfs_readdir(struct vop_readdir_args *ap)
|
||||
ssize_t tresid, left;
|
||||
int error = 0;
|
||||
struct vattr vattr;
|
||||
|
||||
|
||||
if (ap->a_eofflag != NULL)
|
||||
*ap->a_eofflag = 0;
|
||||
if (vp->v_type != VDIR)
|
||||
if (vp->v_type != VDIR)
|
||||
return(EPERM);
|
||||
|
||||
/*
|
||||
@@ -2358,7 +2358,7 @@ nfs_readdir(struct vop_readdir_args *ap)
|
||||
if (ap->a_eofflag != NULL)
|
||||
*ap->a_eofflag = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Add the partial DIRBLKSIZ (left) back in. */
|
||||
uio->uio_resid += left;
|
||||
return (error);
|
||||
@@ -2392,7 +2392,7 @@ ncl_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
|
||||
cookie = *cookiep;
|
||||
ncl_dircookie_unlock(dnp);
|
||||
} else {
|
||||
ncl_dircookie_unlock(dnp);
|
||||
ncl_dircookie_unlock(dnp);
|
||||
return (NFSERR_BAD_COOKIE);
|
||||
}
|
||||
|
||||
@@ -2510,11 +2510,11 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
|
||||
sp->s_dvp = dvp;
|
||||
VREF(dvp);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Fudge together a funny name.
|
||||
* Changing the format of the funny name to accommodate more
|
||||
* Changing the format of the funny name to accommodate more
|
||||
* sillynames per directory.
|
||||
* The name is now changed to .nfs.<ticks>.<pid>.4, where ticks is
|
||||
* The name is now changed to .nfs.<ticks>.<pid>.4, where ticks is
|
||||
* CPU ticks since boot.
|
||||
*/
|
||||
#ifndef __rtems__
|
||||
@@ -2524,8 +2524,8 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
|
||||
#endif /* __rtems__ */
|
||||
lticks = (unsigned int)ticks;
|
||||
for ( ; ; ) {
|
||||
sp->s_namlen = sprintf(sp->s_name,
|
||||
".nfs.%08x.%04x4.4", lticks,
|
||||
sp->s_namlen = sprintf(sp->s_name,
|
||||
".nfs.%08x.%04x4.4", lticks,
|
||||
pid);
|
||||
if (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,
|
||||
cnp->cn_thread, NULL))
|
||||
@@ -3061,12 +3061,12 @@ loop:
|
||||
while (np->n_directio_asyncwr > 0) {
|
||||
np->n_flag |= NFSYNCWAIT;
|
||||
error = newnfs_msleep(td, &np->n_directio_asyncwr,
|
||||
&np->n_mtx, slpflag | (PRIBIO + 1),
|
||||
&np->n_mtx, slpflag | (PRIBIO + 1),
|
||||
"nfsfsync", 0);
|
||||
if (error) {
|
||||
if (newnfs_sigintr(nmp, td)) {
|
||||
NFSUNLOCKNODE(np);
|
||||
error = EINTR;
|
||||
error = EINTR;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -3126,7 +3126,7 @@ nfs_advlock(struct vop_advlock_args *ap)
|
||||
struct vattr va;
|
||||
int ret, error = EOPNOTSUPP;
|
||||
u_quad_t size;
|
||||
|
||||
|
||||
ret = NFSVOPLOCK(vp, LK_SHARED);
|
||||
if (ret != 0)
|
||||
return (EBADF);
|
||||
@@ -3261,7 +3261,7 @@ nfs_advlockasync(struct vop_advlockasync_args *ap)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
u_quad_t size;
|
||||
int error;
|
||||
|
||||
|
||||
if (NFS_ISV4(vp))
|
||||
return (EOPNOTSUPP);
|
||||
error = NFSVOPLOCK(vp, LK_SHARED);
|
||||
@@ -3409,7 +3409,7 @@ nfsfifo_read(struct vop_read_args *ap)
|
||||
vfs_timestamp(&np->n_atim);
|
||||
NFSUNLOCKNODE(np);
|
||||
error = fifo_specops.vop_read(ap);
|
||||
return error;
|
||||
return error;
|
||||
#else /* __rtems__ */
|
||||
return (EINVAL);
|
||||
#endif /* __rtems__ */
|
||||
@@ -3646,3 +3646,4 @@ nfs_pathconf(struct vop_pathconf_args *ap)
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
@@ -1852,6 +1852,7 @@ crget(void)
|
||||
struct ucred *
|
||||
crhold(struct ucred *cr)
|
||||
{
|
||||
|
||||
#ifdef __rtems__
|
||||
if (cr == NULL)
|
||||
return (cr);
|
||||
|
@@ -2967,7 +2967,7 @@ vfs_vmio_invalidate(struct buf *bp)
|
||||
BUF_CHECK_MAPPED(bp);
|
||||
#ifndef __rtems__
|
||||
pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages);
|
||||
#endif /* _-rtems__ */
|
||||
#endif /* __rtems__ */
|
||||
} else
|
||||
BUF_CHECK_UNMAPPED(bp);
|
||||
/*
|
||||
|
@@ -538,3 +538,4 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, int *extflagsp,
|
||||
lockmgr(&mp->mnt_explock, LK_RELEASE, NULL);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@@ -3536,7 +3536,6 @@ again:
|
||||
AUDITVNODE1, pathseg, old, oldfd,
|
||||
&cap_renameat_source_rights, td);
|
||||
#else
|
||||
|
||||
NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1,
|
||||
pathseg, old, oldfd,
|
||||
&cap_renameat_source_rights, td);
|
||||
|
@@ -1252,7 +1252,6 @@ int
|
||||
vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio)
|
||||
{
|
||||
#ifndef __rtems__
|
||||
return (EFAULT);
|
||||
struct uio transp_uio;
|
||||
struct iovec transp_iov[1];
|
||||
struct thread *td;
|
||||
|
@@ -161,3 +161,4 @@ DECLARE_MODULE(nfssvc, nfssvc_mod, SI_SUB_VFS, SI_ORDER_ANY);
|
||||
|
||||
/* So that loader and kldload(2) can find us, wherever we are.. */
|
||||
MODULE_VERSION(nfssvc, 1);
|
||||
|
||||
|
@@ -1379,7 +1379,6 @@ svc_run(SVCPOOL *pool)
|
||||
#else /* __rtems__ */
|
||||
pool->sp_proc = NULL;
|
||||
#endif /* __rtems__ */
|
||||
|
||||
/* Choose group count based on number of threads and CPUs. */
|
||||
pool->sp_groupcount = max(1, min(SVC_MAXGROUPS,
|
||||
min(pool->sp_maxthreads / 2, mp_ncpus) / 6));
|
||||
|
@@ -199,3 +199,4 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp)
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user