summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-10 12:56:01 +0000
committerkib <kib@FreeBSD.org>2016-08-10 12:56:01 +0000
commit766bcdb0be25655a18ef57e9ed1b5d7c4bcbfe06 (patch)
tree1ff3f4e701f46481f499354556afb9d8dcad5b08
parent64abce83d2a8d489641b882c867c8e1af1707f4a (diff)
downloadFreeBSD-src-766bcdb0be25655a18ef57e9ed1b5d7c4bcbfe06.zip
FreeBSD-src-766bcdb0be25655a18ef57e9ed1b5d7c4bcbfe06.tar.gz
MFC r303710:
Remove unneeded (recursing) Giant acquisition around vprintf(9). MFC r303715: Remove ncl_printf(), use printf(9) directly.
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c14
-rw-r--r--sys/fs/nfsclient/nfs_clsubs.c33
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c10
-rw-r--r--sys/fs/nfsclient/nfsnode.h1
4 files changed, 18 insertions, 40 deletions
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index 5f85eb2..3acc132 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -105,7 +105,7 @@ ncl_getpages(struct vop_getpages_args *ap)
count = ap->a_count;
if ((object = vp->v_object) == NULL) {
- ncl_printf("nfs_getpages: called with non-merged cache vnode??\n");
+ printf("ncl_getpages: called with non-merged cache vnode\n");
return (VM_PAGER_ERROR);
}
@@ -113,7 +113,7 @@ ncl_getpages(struct vop_getpages_args *ap)
mtx_lock(&np->n_mtx);
if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) {
mtx_unlock(&np->n_mtx);
- ncl_printf("nfs_getpages: called on non-cacheable vnode??\n");
+ printf("ncl_getpages: called on non-cacheable vnode\n");
return (VM_PAGER_ERROR);
} else
mtx_unlock(&np->n_mtx);
@@ -176,7 +176,7 @@ ncl_getpages(struct vop_getpages_args *ap)
relpbuf(bp, &ncl_pbuf_freecnt);
if (error && (uio.uio_resid == count)) {
- ncl_printf("nfs_getpages: error %d\n", error);
+ printf("ncl_getpages: error %d\n", error);
VM_OBJECT_WLOCK(object);
for (i = 0; i < npages; ++i) {
if (i != ap->a_reqpage) {
@@ -283,7 +283,7 @@ ncl_putpages(struct vop_putpages_args *ap)
if (newnfs_directio_enable && !newnfs_directio_allow_mmap &&
(np->n_flag & NNONCACHE) && (vp->v_type == VREG)) {
mtx_unlock(&np->n_mtx);
- ncl_printf("ncl_putpages: called on noncache-able vnode??\n");
+ printf("ncl_putpages: called on noncache-able vnode\n");
mtx_lock(&np->n_mtx);
}
@@ -694,7 +694,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
n = np->n_direofoffset - uio->uio_offset;
break;
default:
- ncl_printf(" ncl_bioread: type %x unexpected\n", vp->v_type);
+ printf(" ncl_bioread: type %x unexpected\n", vp->v_type);
bp = NULL;
break;
};
@@ -1137,7 +1137,7 @@ again:
*/
if (bp->b_dirtyend > bcount) {
- ncl_printf("NFS append race @%lx:%d\n",
+ printf("NFS append race @%lx:%d\n",
(long)bp->b_blkno * DEV_BSIZE,
bp->b_dirtyend - bcount);
bp->b_dirtyend = bcount;
@@ -1678,7 +1678,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
bp->b_flags |= B_INVAL;
break;
default:
- ncl_printf("ncl_doio: type %x unexpected\n", vp->v_type);
+ printf("ncl_doio: type %x unexpected\n", vp->v_type);
break;
};
if (error) {
diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c
index 1629cf3..e4848ff 100644
--- a/sys/fs/nfsclient/nfs_clsubs.c
+++ b/sys/fs/nfsclient/nfs_clsubs.c
@@ -163,18 +163,6 @@ ncl_downgrade_vnlock(struct vnode *vp, int old_lock)
}
}
-void
-ncl_printf(const char *fmt, ...)
-{
- va_list ap;
-
- mtx_lock(&Giant);
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
- mtx_unlock(&Giant);
-}
-
#ifdef NFS_ACDEBUG
#include <sys/sysctl.h>
SYSCTL_DECL(_vfs_nfs);
@@ -199,16 +187,13 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
vap = &np->n_vattr.na_vattr;
nmp = VFSTONFS(vp->v_mount);
mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */
-#ifdef NFS_ACDEBUG
- mtx_lock(&Giant); /* ncl_printf() */
-#endif
mtx_lock(&np->n_mtx);
/* XXX n_mtime doesn't seem to be updated on a miss-and-reload */
timeo = (time_second - np->n_mtime.tv_sec) / 10;
#ifdef NFS_ACDEBUG
if (nfs_acdebug>1)
- ncl_printf("nfs_getattrcache: initial timeo = %d\n", timeo);
+ printf("ncl_getattrcache: initial timeo = %d\n", timeo);
#endif
if (vap->va_type == VDIR) {
@@ -225,22 +210,19 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
#ifdef NFS_ACDEBUG
if (nfs_acdebug > 2)
- ncl_printf("acregmin %d; acregmax %d; acdirmin %d; acdirmax %d\n",
- nmp->nm_acregmin, nmp->nm_acregmax,
- nmp->nm_acdirmin, nmp->nm_acdirmax);
+ printf("acregmin %d; acregmax %d; acdirmin %d; acdirmax %d\n",
+ nmp->nm_acregmin, nmp->nm_acregmax,
+ nmp->nm_acdirmin, nmp->nm_acdirmax);
if (nfs_acdebug)
- ncl_printf("nfs_getattrcache: age = %d; final timeo = %d\n",
- (time_second - np->n_attrstamp), timeo);
+ printf("ncl_getattrcache: age = %d; final timeo = %d\n",
+ (time_second - np->n_attrstamp), timeo);
#endif
if ((time_second - np->n_attrstamp) >= timeo &&
(mustflush != 0 || np->n_attrstamp == 0)) {
newnfsstats.attrcache_misses++;
mtx_unlock(&np->n_mtx);
-#ifdef NFS_ACDEBUG
- mtx_unlock(&Giant); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
@@ -268,9 +250,6 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
vaper->va_mtime = np->n_mtim;
}
mtx_unlock(&np->n_mtx);
-#ifdef NFS_ACDEBUG
- mtx_unlock(&Giant); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
return (0);
}
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index faff121..d6f9011 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -1786,7 +1786,7 @@ nfs_rename(struct vop_rename_args *ap)
}
if (fvp == tvp) {
- ncl_printf("nfs_rename: fvp == tvp (can't happen)\n");
+ printf("nfs_rename: fvp == tvp (can't happen)\n");
error = 0;
goto out;
}
@@ -2314,7 +2314,7 @@ ncl_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
dnp->n_direofoffset = uiop->uio_offset;
else {
if (uiop->uio_resid > 0)
- ncl_printf("EEK! readdirrpc resid > 0\n");
+ printf("EEK! readdirrpc resid > 0\n");
ncl_dircookie_lock(dnp);
cookiep = ncl_getcookie(dnp, uiop->uio_offset, 1);
*cookiep = cookie;
@@ -2373,7 +2373,7 @@ ncl_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
dnp->n_direofoffset = uiop->uio_offset;
else {
if (uiop->uio_resid > 0)
- ncl_printf("EEK! readdirplusrpc resid > 0\n");
+ printf("EEK! readdirplusrpc resid > 0\n");
ncl_dircookie_lock(dnp);
cookiep = ncl_getcookie(dnp, uiop->uio_offset, 1);
*cookiep = cookie;
@@ -3146,8 +3146,8 @@ nfs_print(struct vop_print_args *ap)
struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
- ncl_printf("\tfileid %ld fsid 0x%x",
- np->n_vattr.na_fileid, np->n_vattr.na_fsid);
+ printf("\tfileid %ld fsid 0x%x", np->n_vattr.na_fileid,
+ np->n_vattr.na_fsid);
if (vp->v_type == VFIFO)
fifo_printinfo(vp);
printf("\n");
diff --git a/sys/fs/nfsclient/nfsnode.h b/sys/fs/nfsclient/nfsnode.h
index d5cb756..65f6c10 100644
--- a/sys/fs/nfsclient/nfsnode.h
+++ b/sys/fs/nfsclient/nfsnode.h
@@ -185,7 +185,6 @@ nfsuint64 *ncl_getcookie(struct nfsnode *, off_t, int);
void ncl_invaldir(struct vnode *);
int ncl_upgrade_vnlock(struct vnode *);
void ncl_downgrade_vnlock(struct vnode *, int);
-void ncl_printf(const char *, ...);
void ncl_dircookie_lock(struct nfsnode *);
void ncl_dircookie_unlock(struct nfsnode *);
OpenPOWER on IntegriCloud