Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 03:51:59 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241521 - head/sys/fs/fuse
Message-ID:  <201210140351.q9E3pxEe079225@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sun Oct 14 03:51:59 2012
New Revision: 241521
URL: http://svn.freebsd.org/changeset/base/241521

Log:
  Rename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to
  avoid a name clash in sparc64.
  
  MFC after:	2 months
  X-MFC:		r241519

Modified:
  head/sys/fs/fuse/fuse_debug.h
  head/sys/fs/fuse/fuse_device.c
  head/sys/fs/fuse/fuse_file.c
  head/sys/fs/fuse/fuse_io.c
  head/sys/fs/fuse/fuse_ipc.c
  head/sys/fs/fuse/fuse_node.c
  head/sys/fs/fuse/fuse_vfsops.c
  head/sys/fs/fuse/fuse_vnops.c

Modified: head/sys/fs/fuse/fuse_debug.h
==============================================================================
--- head/sys/fs/fuse/fuse_debug.h	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_debug.h	Sun Oct 14 03:51:59 2012	(r241521)
@@ -65,11 +65,11 @@
 #define FUSE_DEBUG_VAR		__CONCAT(FUSE_DEBUG_,FUSE_DEBUG_MODULE)
 #endif
 
-#define DEBUG(fmt, ...)         DEBUGX(FUSE_DEBUG_VAR >= 1, fmt, ## __VA_ARGS__)
-#define DEBUG2G(fmt, ...)       DEBUGX(FUSE_DEBUG_VAR >= 2, fmt, ## __VA_ARGS__)
+#define	FS_DEBUG(fmt, ...)	DEBUGX(FUSE_DEBUG_VAR >= 1, fmt, ## __VA_ARGS__)
+#define	FS_DEBUG2G(fmt, ...)	DEBUGX(FUSE_DEBUG_VAR >= 2, fmt, ## __VA_ARGS__)
 
-#define debug_printf(fmt, ...)  DEBUG(fmt, ## __VA_ARGS__)
-#define kdebug_printf(fmt, ...) DEBUG(fmt, ## __VA_ARGS__)
+#define	debug_printf(fmt, ...)	FS_DEBUG(fmt, ## __VA_ARGS__)
+#define	kdebug_printf(fmt, ...)	FS_DEBUG(fmt, ## __VA_ARGS__)
 
 #define fuse_trace_printf(fmt, ...) \
     DEBUGX(FUSE_DEBUG_VAR && FUSE_TRACE, fmt, ## __VA_ARGS__)

Modified: head/sys/fs/fuse/fuse_device.c
==============================================================================
--- head/sys/fs/fuse/fuse_device.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_device.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -126,14 +126,14 @@ fuse_device_open(struct cdev *dev, int o
 	struct fuse_data *fdata;
 	int error;
 
-	DEBUG("device %p\n", dev);
+	FS_DEBUG("device %p\n", dev);
 
 	fdata = fdata_alloc(dev, td->td_ucred);
 	error = devfs_set_cdevpriv(fdata, fdata_dtor);
 	if (error != 0)
 		fdata_trydestroy(fdata);
 	else
-		DEBUG("%s: device opened by thread %d.\n", dev->si_name,
+		FS_DEBUG("%s: device opened by thread %d.\n", dev->si_name,
 		    td->td_tid);
 	return (error);
 }
@@ -169,7 +169,7 @@ fuse_device_close(struct cdev *dev, int 
 	fuse_lck_mtx_unlock(data->aw_mtx);
 	FUSE_UNLOCK();
 
-	DEBUG("%s: device closed by thread %d.\n", dev->si_name, td->td_tid);
+	FS_DEBUG("%s: device closed by thread %d.\n", dev->si_name, td->td_tid);
 	return (0);
 }
 
@@ -213,7 +213,7 @@ fuse_device_read(struct cdev *dev, struc
 	int buflen[3];
 	int i;
 
-	DEBUG("fuse device being read on thread %d\n", uio->uio_td->td_tid);
+	FS_DEBUG("fuse device being read on thread %d\n", uio->uio_td->td_tid);
 
 	err = devfs_get_cdevpriv((void **)&data);
 	if (err != 0)
@@ -222,7 +222,7 @@ fuse_device_read(struct cdev *dev, struc
 	fuse_lck_mtx_lock(data->ms_mtx);
 again:
 	if (fdata_get_dead(data)) {
-		DEBUG2G("we know early on that reader should be kicked so we don't wait for news\n");
+		FS_DEBUG2G("we know early on that reader should be kicked so we don't wait for news\n");
 		fuse_lck_mtx_unlock(data->ms_mtx);
 		return (ENODEV);
 	}
@@ -248,7 +248,7 @@ again:
 		 * -- and some other cases, too, tho not totally clear, when
 		 * (cv_signal/wakeup_one signals the whole process ?)
 		 */
-		DEBUG("no message on thread #%d\n", uio->uio_td->td_tid);
+		FS_DEBUG("no message on thread #%d\n", uio->uio_td->td_tid);
 		goto again;
 	}
 	fuse_lck_mtx_unlock(data->ms_mtx);
@@ -258,16 +258,16 @@ again:
 		 * somebody somewhere -- eg., umount routine --
 		 * wants this liaison finished off
 		 */
-		DEBUG2G("reader is to be sacked\n");
+		FS_DEBUG2G("reader is to be sacked\n");
 		if (tick) {
-			DEBUG2G("weird -- \"kick\" is set tho there is message\n");
+			FS_DEBUG2G("weird -- \"kick\" is set tho there is message\n");
 			FUSE_ASSERT_MS_DONE(tick);
 			fuse_ticket_drop(tick);
 		}
 		return (ENODEV);	/* This should make the daemon get off
 					 * of us */
 	}
-	DEBUG("message got on thread #%d\n", uio->uio_td->td_tid);
+	FS_DEBUG("message got on thread #%d\n", uio->uio_td->td_tid);
 
 	KASSERT(tick->tk_ms_bufdata || tick->tk_ms_bufsize == 0,
 	    ("non-null buf pointer with positive size"));
@@ -301,7 +301,7 @@ again:
 		 */
 		if (uio->uio_resid < buflen[i]) {
 			fdata_set_dead(data);
-			DEBUG2G("daemon is stupid, kick it off...\n");
+			FS_DEBUG2G("daemon is stupid, kick it off...\n");
 			err = ENODEV;
 			break;
 		}
@@ -319,16 +319,16 @@ again:
 static __inline int
 fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio)
 {
-	DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n",
+	FS_DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n",
 	    ohead->len, ohead->error, (unsigned long long)ohead->unique,
 	    uio->uio_iovcnt);
 
 	if (uio->uio_resid + sizeof(struct fuse_out_header) != ohead->len) {
-		DEBUG("Format error: body size differs from size claimed by header\n");
+		FS_DEBUG("Format error: body size differs from size claimed by header\n");
 		return (EINVAL);
 	}
 	if (uio->uio_resid && ohead->error) {
-		DEBUG("Format error: non zero error but message had a body\n");
+		FS_DEBUG("Format error: non zero error but message had a body\n");
 		return (EINVAL);
 	}
 	/* Sanitize the linuxism of negative errnos */
@@ -352,7 +352,7 @@ fuse_device_write(struct cdev *dev, stru
 	struct fuse_ticket *tick, *x_tick;
 	int found = 0;
 
-	DEBUG("resid: %zd, iovcnt: %d, thread: %d\n",
+	FS_DEBUG("resid: %zd, iovcnt: %d, thread: %d\n",
 	    uio->uio_resid, uio->uio_iovcnt, uio->uio_td->td_tid);
 
 	err = devfs_get_cdevpriv((void **)&data);
@@ -360,7 +360,7 @@ fuse_device_write(struct cdev *dev, stru
 		return (err);
 
 	if (uio->uio_resid < sizeof(struct fuse_out_header)) {
-		DEBUG("got less than a header!\n");
+		FS_DEBUG("got less than a header!\n");
 		fdata_set_dead(data);
 		return (EINVAL);
 	}
@@ -384,7 +384,7 @@ fuse_device_write(struct cdev *dev, stru
 	fuse_lck_mtx_lock(data->aw_mtx);
 	TAILQ_FOREACH_SAFE(tick, &data->aw_head, tk_aw_link,
 	    x_tick) {
-		DEBUG("bumped into callback #%llu\n",
+		FS_DEBUG("bumped into callback #%llu\n",
 		    (unsigned long long)tick->tk_unique);
 		if (tick->tk_unique == ohead.unique) {
 			found = 1;
@@ -404,12 +404,12 @@ fuse_device_write(struct cdev *dev, stru
 			 * via ticket_drop(), so no manual mucking
 			 * around...)
 			 */
-			DEBUG("pass ticket to a callback\n");
+			FS_DEBUG("pass ticket to a callback\n");
 			memcpy(&tick->tk_aw_ohead, &ohead, sizeof(ohead));
 			err = tick->tk_aw_handler(tick, uio);
 		} else {
 			/* pretender doesn't wanna do anything with answer */
-			DEBUG("stuff devalidated, so we drop it\n");
+			FS_DEBUG("stuff devalidated, so we drop it\n");
 		}
 
 		/*
@@ -420,7 +420,7 @@ fuse_device_write(struct cdev *dev, stru
 		fuse_ticket_drop(tick);
 	} else {
 		/* no callback at all! */
-		DEBUG("erhm, no handler for this response\n");
+		FS_DEBUG("erhm, no handler for this response\n");
 		err = EINVAL;
 	}
 

Modified: head/sys/fs/fuse/fuse_file.c
==============================================================================
--- head/sys/fs/fuse/fuse_file.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_file.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -245,7 +245,7 @@ fuse_filehandle_init(struct vnode *vp,
 	struct fuse_vnode_data *fvdat = VTOFUD(vp);
 	struct fuse_filehandle *fufh;
 
-	DEBUG("id=%jd type=%d\n", (intmax_t)fh_id, fufh_type);
+	FS_DEBUG("id=%jd type=%d\n", (intmax_t)fh_id, fufh_type);
 	fufh = &(fvdat->fufh[fufh_type]);
 	MPASS(!FUFH_IS_VALID(fufh));
 	fufh->fh_id = fh_id;

Modified: head/sys/fs/fuse/fuse_io.c
==============================================================================
--- head/sys/fs/fuse/fuse_io.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_io.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -145,23 +145,23 @@ fuse_io_dispatch(struct vnode *vp, struc
 	switch (uio->uio_rw) {
 	case UIO_READ:
 		if (directio) {
-			DEBUG("direct read of vnode %ju via file handle %ju\n",
+			FS_DEBUG("direct read of vnode %ju via file handle %ju\n",
 			    (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id);
 			err = fuse_read_directbackend(vp, uio, cred, fufh);
 		} else {
-			DEBUG("buffered read of vnode %ju\n", 
+			FS_DEBUG("buffered read of vnode %ju\n", 
 			      (uintmax_t)VTOILLU(vp));
 			err = fuse_read_biobackend(vp, uio, cred, fufh);
 		}
 		break;
 	case UIO_WRITE:
 		if (directio) {
-			DEBUG("direct write of vnode %ju via file handle %ju\n",
+			FS_DEBUG("direct write of vnode %ju via file handle %ju\n",
 			    (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id);
 			err = fuse_write_directbackend(vp, uio, cred, fufh);
 			fuse_invalidate_attr(vp);
 		} else {
-			DEBUG("buffered write of vnode %ju\n", 
+			FS_DEBUG("buffered write of vnode %ju\n", 
 			      (uintmax_t)VTOILLU(vp));
 			err = fuse_write_biobackend(vp, uio, cred, fufh);
 		}
@@ -185,7 +185,7 @@ fuse_read_biobackend(struct vnode *vp, s
 
 	const int biosize = fuse_iosize(vp);
 
-	DEBUG("resid=%zx offset=%jx fsize=%jx\n",
+	FS_DEBUG("resid=%zx offset=%jx fsize=%jx\n",
 	    uio->uio_resid, uio->uio_offset, VTOFUD(vp)->filesize);
 
 	if (uio->uio_resid == 0)
@@ -204,7 +204,7 @@ fuse_read_biobackend(struct vnode *vp, s
 		lbn = uio->uio_offset / biosize;
 		on = uio->uio_offset & (biosize - 1);
 
-		DEBUG2G("biosize %d, lbn %d, on %d\n", biosize, (int)lbn, on);
+		FS_DEBUG2G("biosize %d, lbn %d, on %d\n", biosize, (int)lbn, on);
 
 		/*
 	         * Obtain the buffer cache block.  Figure out the buffer size
@@ -253,13 +253,13 @@ fuse_read_biobackend(struct vnode *vp, s
 		if (on < bcount)
 			n = MIN((unsigned)(bcount - on), uio->uio_resid);
 		if (n > 0) {
-			DEBUG2G("feeding buffeater with %d bytes of buffer %p,"
+			FS_DEBUG2G("feeding buffeater with %d bytes of buffer %p,"
 				" saying %d was asked for\n",
 				n, bp->b_data + on, n + (int)bp->b_resid);
 			err = uiomove(bp->b_data + on, n, uio);
 		}
 		brelse(bp);
-		DEBUG2G("end of turn, err %d, uio->uio_resid %zd, n %d\n",
+		FS_DEBUG2G("end of turn, err %d, uio->uio_resid %zd, n %d\n",
 		    err, uio->uio_resid, n);
 	} while (err == 0 && uio->uio_resid > 0 && n > 0);
 
@@ -296,14 +296,14 @@ fuse_read_directbackend(struct vnode *vp
 		fri->size = MIN(uio->uio_resid,
 		    fuse_get_mpdata(vp->v_mount)->max_read);
 
-		DEBUG2G("fri->fh %ju, fri->offset %ju, fri->size %ju\n",
+		FS_DEBUG2G("fri->fh %ju, fri->offset %ju, fri->size %ju\n",
 			(uintmax_t)fri->fh, (uintmax_t)fri->offset, 
 			(uintmax_t)fri->size);
 
 		if ((err = fdisp_wait_answ(&fdi)))
 			goto out;
 
-		DEBUG2G("complete: got iosize=%d, requested fri.size=%zd; "
+		FS_DEBUG2G("complete: got iosize=%d, requested fri.size=%zd; "
 			"resid=%zd offset=%ju\n",
 			fri->size, fdi.iosize, uio->uio_resid, 
 			(uintmax_t)uio->uio_offset);
@@ -383,7 +383,7 @@ fuse_write_biobackend(struct vnode *vp, 
 	const int biosize = fuse_iosize(vp);
 
 	KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode"));
-	DEBUG("resid=%zx offset=%jx fsize=%jx\n",
+	FS_DEBUG("resid=%zx offset=%jx fsize=%jx\n",
 	    uio->uio_resid, uio->uio_offset, fvdat->filesize);
 	if (vp->v_type != VREG)
 		return (EIO);
@@ -409,7 +409,7 @@ fuse_write_biobackend(struct vnode *vp, 
 		on = uio->uio_offset & (biosize - 1);
 		n = MIN((unsigned)(biosize - on), uio->uio_resid);
 
-		DEBUG2G("lbn %ju, on %d, n %d, uio offset %ju, uio resid %zd\n",
+		FS_DEBUG2G("lbn %ju, on %d, n %d, uio offset %ju, uio resid %zd\n",
 			(uintmax_t)lbn, on, n, 
 			(uintmax_t)uio->uio_offset, uio->uio_resid);
 
@@ -426,7 +426,7 @@ again:
 	                 * readers from reading garbage.
 	                 */
 			bcount = on;
-			DEBUG("getting block from OS, bcount %d\n", bcount);
+			FS_DEBUG("getting block from OS, bcount %d\n", bcount);
 			bp = getblk(vp, lbn, bcount, PCATCH, 0, 0);
 
 			if (bp != NULL) {
@@ -456,7 +456,7 @@ again:
 					bcount = fvdat->filesize - 
 					  (off_t)lbn *biosize;
 			}
-			DEBUG("getting block from OS, bcount %d\n", bcount);
+			FS_DEBUG("getting block from OS, bcount %d\n", bcount);
 			bp = getblk(vp, lbn, bcount, PCATCH, 0, 0);
 			if (bp && uio->uio_offset + n > fvdat->filesize) {
 				err = fuse_vnode_setsize(vp, cred, 
@@ -518,7 +518,7 @@ again:
 	         */
 
 		if (bp->b_dirtyend > bcount) {
-			DEBUG("FUSE append race @%lx:%d\n",
+			FS_DEBUG("FUSE append race @%lx:%d\n",
 			    (long)bp->b_blkno * biosize,
 			    bp->b_dirtyend - bcount);
 			bp->b_dirtyend = bcount;
@@ -614,7 +614,7 @@ fuse_io_strategy(struct vnode *vp, struc
 
 	MPASS(vp->v_type == VREG);
 	MPASS(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE);
-	DEBUG("inode=%ju offset=%jd resid=%ld\n",
+	FS_DEBUG("inode=%ju offset=%jd resid=%ld\n",
 	    (uintmax_t)VTOI(vp), (intmax_t)(((off_t)bp->b_blkno) * biosize),
 	    bp->b_bcount);
 
@@ -688,7 +688,7 @@ fuse_io_strategy(struct vnode *vp, struc
 	         * If we only need to commit, try to commit
 	         */
 		if (bp->b_flags & B_NEEDCOMMIT) {
-			DEBUG("write: B_NEEDCOMMIT flags set\n");
+			FS_DEBUG("write: B_NEEDCOMMIT flags set\n");
 		}
 		/*
 	         * Setup for actual write

Modified: head/sys/fs/fuse/fuse_ipc.c
==============================================================================
--- head/sys/fs/fuse/fuse_ipc.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_ipc.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -246,7 +246,7 @@ fticket_init(void *mem, int size, int fl
 {
 	struct fuse_ticket *ftick = mem;
 
-	DEBUG("ftick=%p\n", ftick);
+	FS_DEBUG("ftick=%p\n", ftick);
 
 	bzero(ftick, sizeof(struct fuse_ticket));
 
@@ -265,7 +265,7 @@ fticket_fini(void *mem, int size)
 {
 	struct fuse_ticket *ftick = mem;
 
-	DEBUG("ftick=%p\n", ftick);
+	FS_DEBUG("ftick=%p\n", ftick);
 
 	fiov_teardown(&ftick->tk_ms_fiov);
 	fiov_teardown(&ftick->tk_aw_fiov);
@@ -433,10 +433,10 @@ fdata_alloc(struct cdev *fdev, struct uc
 void
 fdata_trydestroy(struct fuse_data *data)
 {
-	DEBUG("data=%p data.mp=%p data.fdev=%p data.flags=%04x\n",
+	FS_DEBUG("data=%p data.mp=%p data.fdev=%p data.flags=%04x\n",
 	    data, data->mp, data->fdev, data->dataflags);
 
-	DEBUG("destroy: data=%p\n", data);
+	FS_DEBUG("destroy: data=%p\n", data);
 	data->ref--;
 	MPASS(data->ref >= 0);
 	if (data->ref != 0)

Modified: head/sys/fs/fuse/fuse_node.c
==============================================================================
--- head/sys/fs/fuse/fuse_node.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_node.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -180,7 +180,7 @@ fuse_vnode_alloc(struct mount *mp,
 	struct vnode *vp2;
 	int err = 0;
 
-	DEBUG("been asked for vno #%ju\n", (uintmax_t)nodeid);
+	FS_DEBUG("been asked for vno #%ju\n", (uintmax_t)nodeid);
 
 	if (vtyp == VNON) {
 		return EINVAL;
@@ -193,7 +193,7 @@ fuse_vnode_alloc(struct mount *mp,
 
 	if (*vpp) {
 		MPASS((*vpp)->v_type == vtyp && (*vpp)->v_data != NULL);
-		DEBUG("vnode taken from hash\n");
+		FS_DEBUG("vnode taken from hash\n");
 		return (0);
 	}
 	fvdat = malloc(sizeof(*fvdat), M_FUSEVN, M_WAITOK | M_ZERO);
@@ -302,7 +302,7 @@ fuse_vnode_savesize(struct vnode *vp, st
 	struct fuse_setattr_in *fsai;
 	int err = 0;
 
-	DEBUG("inode=%ju size=%ju\n", (uintmax_t)VTOI(vp),
+	FS_DEBUG("inode=%ju size=%ju\n", (uintmax_t)VTOI(vp),
 	    (uintmax_t)fvdat->filesize);
 	ASSERT_VOP_ELOCKED(vp, "fuse_io_extend");
 
@@ -355,7 +355,7 @@ fuse_vnode_refreshsize(struct vnode *vp,
 		return;
 
 	VOP_GETATTR(vp, &va, cred);
-	DEBUG("refreshed file size: %jd\n", (intmax_t)VTOFUD(vp)->filesize);
+	FS_DEBUG("refreshed file size: %jd\n", (intmax_t)VTOFUD(vp)->filesize);
 }
 
 int
@@ -365,7 +365,7 @@ fuse_vnode_setsize(struct vnode *vp, str
 	off_t oldsize;
 	int err = 0;
 
-	DEBUG("inode=%ju oldsize=%ju newsize=%ju\n",
+	FS_DEBUG("inode=%ju oldsize=%ju newsize=%ju\n",
 	    (uintmax_t)VTOI(vp), (uintmax_t)fvdat->filesize,
 	    (uintmax_t)newsize);
 	ASSERT_VOP_ELOCKED(vp, "fuse_vnode_setsize");

Modified: head/sys/fs/fuse/fuse_vfsops.c
==============================================================================
--- head/sys/fs/fuse/fuse_vfsops.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_vfsops.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -285,11 +285,11 @@ fuse_vfsop_mount(struct mount *mp)
 	}
 	subtype = vfs_getopts(opts, "subtype=", &err);
 
-	DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts);
+	FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts);
 
 	err = fget(td, fd, CAP_READ, &fp);
 	if (err != 0) {
-		DEBUG("invalid or not opened device: data=%p\n", data);
+		FS_DEBUG("invalid or not opened device: data=%p\n", data);
 		goto out;
 	}
 	fptmp = td->td_fpop;
@@ -299,14 +299,14 @@ fuse_vfsop_mount(struct mount *mp)
 	fdrop(fp, td);
 	FUSE_LOCK();
 	if (err != 0 || data == NULL || data->mp != NULL) {
-		DEBUG("invalid or not opened device: data=%p data.mp=%p\n",
+		FS_DEBUG("invalid or not opened device: data=%p data.mp=%p\n",
 		    data, data != NULL ? data->mp : NULL);
 		err = ENXIO;
 		FUSE_UNLOCK();
 		goto out;
 	}
 	if (fdata_get_dead(data)) {
-		DEBUG("device is dead during mount: data=%p\n", data);
+		FS_DEBUG("device is dead during mount: data=%p\n", data);
 		err = ENOTCONN;
 		FUSE_UNLOCK();
 		goto out;
@@ -346,7 +346,7 @@ fuse_vfsop_mount(struct mount *mp)
 	}
 	copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len);
 	bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len);
-	DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname);
+	FS_DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname);
 
 	/* Now handshaking with daemon */
 	fuse_internal_send_init(data, td);
@@ -359,7 +359,7 @@ out:
 			 * Destroy device only if we acquired reference to
 			 * it
 			 */
-			DEBUG("mount failed, destroy device: data=%p mp=%p"
+			FS_DEBUG("mount failed, destroy device: data=%p mp=%p"
 			      " err=%d\n",
 			    data, mp, err);
 			data->mp = NULL;
@@ -450,12 +450,12 @@ fuse_vfsop_root(struct mount *mp, int lk
 			FUSE_LOCK();
 			MPASS(data->vroot == NULL || data->vroot == *vpp);
 			if (data->vroot == NULL) {
-				DEBUG("new root vnode\n");
+				FS_DEBUG("new root vnode\n");
 				data->vroot = *vpp;
 				FUSE_UNLOCK();
 				vref(*vpp);
 			} else if (data->vroot != *vpp) {
-				DEBUG("root vnode race\n");
+				FS_DEBUG("root vnode race\n");
 				FUSE_UNLOCK();
 				VOP_UNLOCK(*vpp, 0);
 				vrele(*vpp);
@@ -477,7 +477,7 @@ fuse_vfsop_statfs(struct mount *mp, stru
 	struct fuse_statfs_out *fsfo;
 	struct fuse_data *data;
 
-	DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname);
+	FS_DEBUG2G("mp %p: %s\n", mp, mp->mnt_stat.f_mntfromname);
 	data = fuse_get_mpdata(mp);
 
 	if (!(data->dataflags & FSESS_INITED))
@@ -508,7 +508,7 @@ fuse_vfsop_statfs(struct mount *mp, stru
 	sbp->f_namemax = fsfo->st.namelen;
 	sbp->f_bsize = fsfo->st.frsize;	/* cast from uint32_t to uint64_t */
 
-	DEBUG("fuse_statfs_out -- blocks: %llu, bfree: %llu, bavail: %llu, "
+	FS_DEBUG("fuse_statfs_out -- blocks: %llu, bfree: %llu, bavail: %llu, "
 	      "fil	es: %llu, ffree: %llu, bsize: %i, namelen: %i\n",
 	      (unsigned long long)fsfo->st.blocks, 
 	      (unsigned long long)fsfo->st.bfree,

Modified: head/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- head/sys/fs/fuse/fuse_vnops.c	Sun Oct 14 03:40:08 2012	(r241520)
+++ head/sys/fs/fuse/fuse_vnops.c	Sun Oct 14 03:51:59 2012	(r241521)
@@ -219,7 +219,7 @@ fuse_vnop_access(struct vop_access_args 
 
 	int err;
 
-	DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	if (fuse_isdeadfs(vp)) {
 		if (vnode_isvroot(vp)) {
@@ -242,7 +242,7 @@ fuse_vnop_access(struct vop_access_args 
 	bzero(&facp, sizeof(facp));
 
 	err = fuse_internal_access(vp, accmode, &facp, ap->a_td, ap->a_cred);
-	DEBUG2G("err=%d accmode=0x%x\n", err, accmode);
+	FS_DEBUG2G("err=%d accmode=0x%x\n", err, accmode);
 	return err;
 }
 
@@ -478,7 +478,7 @@ fuse_vnop_getattr(struct vop_getattr_arg
 	int dataflags;
 	struct fuse_dispatcher fdi;
 
-	DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	dataflags = fuse_get_mpdata(vnode_mount(vp))->dataflags;
 
@@ -567,7 +567,7 @@ fuse_vnop_inactive(struct vop_inactive_a
 
 	int type, need_flush = 1;
 
-	DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	for (type = 0; type < FUFH_MAXTYPE; type++) {
 		fufh = &(fvdat->fufh[type]);
@@ -678,7 +678,7 @@ fuse_vnop_lookup(struct vop_lookup_args 
 	uint64_t nid;
 	struct fuse_access_param facp;
 
-	DEBUG2G("parent_inode=%ju - %*s\n",
+	FS_DEBUG2G("parent_inode=%ju - %*s\n",
 	    (uintmax_t)VTOI(dvp), (int)cnp->cn_namelen, cnp->cn_nameptr);
 
 	if (fuse_isdeadfs(dvp)) {
@@ -808,7 +808,7 @@ calldaemon:
 	         */
 #if 0
 		if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) {
-			DEBUG("inserting NULL into cache\n");
+			FS_DEBUG("inserting NULL into cache\n");
 			cache_enter(dvp, NULL, cnp);
 		}
 #endif
@@ -1058,7 +1058,7 @@ out:
 				}
 				if (err) {
 					if (tmpvtype == VLNK)
-						DEBUG("weird, permission error with a symlink?\n");
+						FS_DEBUG("weird, permission error with a symlink?\n");
 					vput(*vpp);
 					*vpp = NULL;
 				}
@@ -1145,7 +1145,7 @@ fuse_vnop_open(struct vop_open_args *ap)
 
 	int error, isdir = 0;
 
-	DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode);
+	FS_DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode);
 
 	if (fuse_isdeadfs(vp)) {
 		return ENXIO;
@@ -1186,7 +1186,7 @@ fuse_vnop_read(struct vop_read_args *ap)
 	int ioflag = ap->a_ioflag;
 	struct ucred *cred = ap->a_cred;
 
-	DEBUG2G("inode=%ju offset=%jd resid=%zd\n",
+	FS_DEBUG2G("inode=%ju offset=%jd resid=%zd\n",
 	    (uintmax_t)VTOI(vp), uio->uio_offset, uio->uio_resid);
 
 	if (fuse_isdeadfs(vp)) {
@@ -1219,7 +1219,7 @@ fuse_vnop_readdir(struct vop_readdir_arg
 	int err = 0;
 	int freefufh = 0;
 
-	DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	if (fuse_isdeadfs(vp)) {
 		return ENXIO;
@@ -1231,7 +1231,7 @@ fuse_vnop_readdir(struct vop_readdir_arg
 	fvdat = VTOFUD(vp);
 
 	if (!fuse_filehandle_valid(vp, FUFH_RDONLY)) {
-		DEBUG("calling readdir() before open()");
+		FS_DEBUG("calling readdir() before open()");
 		err = fuse_filehandle_open(vp, FUFH_RDONLY, &fufh, NULL, cred);
 		freefufh = 1;
 	} else {
@@ -1269,7 +1269,7 @@ fuse_vnop_readlink(struct vop_readlink_a
 	struct fuse_dispatcher fdi;
 	int err;
 
-	DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	if (fuse_isdeadfs(vp)) {
 		return ENXIO;
@@ -1316,7 +1316,7 @@ fuse_vnop_reclaim(struct vop_reclaim_arg
 	if (!fvdat) {
 		panic("FUSE: no vnode data during recycling");
 	}
-	DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	for (type = 0; type < FUFH_MAXTYPE; type++) {
 		fufh = &(fvdat->fufh[type]);
@@ -1356,7 +1356,7 @@ fuse_vnop_remove(struct vop_remove_args 
 
 	int err;
 
-	DEBUG2G("inode=%ju name=%*s\n",
+	FS_DEBUG2G("inode=%ju name=%*s\n",
 	    (uintmax_t)VTOI(vp), (int)cnp->cn_namelen, cnp->cn_nameptr);
 
 	if (fuse_isdeadfs(vp)) {
@@ -1399,7 +1399,7 @@ fuse_vnop_rename(struct vop_rename_args 
 
 	int err = 0;
 
-	DEBUG2G("from: inode=%ju name=%*s -> to: inode=%ju name=%*s\n",
+	FS_DEBUG2G("from: inode=%ju name=%*s -> to: inode=%ju name=%*s\n",
 	    (uintmax_t)VTOI(fvp), (int)fcnp->cn_namelen, fcnp->cn_nameptr,
 	    (uintmax_t)(tvp == NULL ? -1 : VTOI(tvp)),
 	    (int)tcnp->cn_namelen, tcnp->cn_nameptr);
@@ -1409,7 +1409,7 @@ fuse_vnop_rename(struct vop_rename_args 
 	}
 	if (fvp->v_mount != tdvp->v_mount ||
 	    (tvp && fvp->v_mount != tvp->v_mount)) {
-		DEBUG("cross-device rename: %s -> %s\n",
+		FS_DEBUG("cross-device rename: %s -> %s\n",
 		    fcnp->cn_nameptr, (tcnp != NULL ? tcnp->cn_nameptr : "(NULL)"));
 		err = EXDEV;
 		goto out;
@@ -1474,7 +1474,7 @@ fuse_vnop_rmdir(struct vop_rmdir_args *a
 
 	int err;
 
-	DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	if (fuse_isdeadfs(vp)) {
 		return ENXIO;
@@ -1516,7 +1516,7 @@ fuse_vnop_setattr(struct vop_setattr_arg
 	int sizechanged = 0;
 	uint64_t newsize = 0;
 
-	DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
+	FS_DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp));
 
 	if (fuse_isdeadfs(vp)) {
 		return ENXIO;
@@ -1693,7 +1693,7 @@ fuse_vnop_symlink(struct vop_symlink_arg
 	int err;
 	size_t len;
 
-	DEBUG2G("inode=%ju name=%*s\n",
+	FS_DEBUG2G("inode=%ju name=%*s\n",
 	    (uintmax_t)VTOI(dvp), (int)cnp->cn_namelen, cnp->cn_nameptr);
 
 	if (fuse_isdeadfs(dvp)) {
@@ -1772,7 +1772,7 @@ fuse_vnop_getpages(struct vop_getpages_a
 	struct ucred *cred;
 	vm_page_t *pages;
 
-	DEBUG2G("heh\n");
+	FS_DEBUG2G("heh\n");
 
 	vp = ap->a_vp;
 	KASSERT(vp->v_object, ("objectless vp passed to getpages"));
@@ -1782,7 +1782,7 @@ fuse_vnop_getpages(struct vop_getpages_a
 	count = ap->a_count;
 
 	if (!fsess_opt_mmap(vnode_mount(vp))) {
-		DEBUG("called on non-cacheable vnode??\n");
+		FS_DEBUG("called on non-cacheable vnode??\n");
 		return (VM_PAGER_ERROR);
 	}
 	npages = btoc(count);
@@ -1837,7 +1837,7 @@ fuse_vnop_getpages(struct vop_getpages_a
 	relpbuf(bp, &fuse_pbuf_freecnt);
 
 	if (error && (uio.uio_resid == count)) {
-		DEBUG("error %d\n", error);
+		FS_DEBUG("error %d\n", error);
 		VM_OBJECT_LOCK(vp->v_object);
 		fuse_vm_page_lock_queues();
 		for (i = 0; i < npages; ++i) {
@@ -1951,7 +1951,7 @@ fuse_vnop_putpages(struct vop_putpages_a
 	vm_page_t *pages;
 	vm_ooffset_t fsize;
 
-	DEBUG2G("heh\n");
+	FS_DEBUG2G("heh\n");
 
 	vp = ap->a_vp;
 	KASSERT(vp->v_object, ("objectless vp passed to putpages"));
@@ -1965,7 +1965,7 @@ fuse_vnop_putpages(struct vop_putpages_a
 	offset = IDX_TO_OFF(pages[0]->pindex);
 
 	if (!fsess_opt_mmap(vnode_mount(vp))) {
-		DEBUG("called on non-cacheable vnode??\n");
+		FS_DEBUG("called on non-cacheable vnode??\n");
 	}
 	for (i = 0; i < npages; i++)
 		rtvals[i] = VM_PAGER_AGAIN;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210140351.q9E3pxEe079225>