summaryrefslogtreecommitdiffstats
path: root/sys/fs/fuse
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2012-10-14 03:51:59 +0000
committerattilio <attilio@FreeBSD.org>2012-10-14 03:51:59 +0000
commit95ca52bfbf79a52425f9a9d41a431b16a05faaf1 (patch)
tree89d42cc8ba27b3b8d6d8db58179078214f1e009a /sys/fs/fuse
parent5b3318cf9e10e77fb54570f3bb03cdb9896370c2 (diff)
downloadFreeBSD-src-95ca52bfbf79a52425f9a9d41a431b16a05faaf1.zip
FreeBSD-src-95ca52bfbf79a52425f9a9d41a431b16a05faaf1.tar.gz
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
Diffstat (limited to 'sys/fs/fuse')
-rw-r--r--sys/fs/fuse/fuse_debug.h8
-rw-r--r--sys/fs/fuse/fuse_device.c38
-rw-r--r--sys/fs/fuse/fuse_file.c2
-rw-r--r--sys/fs/fuse/fuse_io.c34
-rw-r--r--sys/fs/fuse/fuse_ipc.c8
-rw-r--r--sys/fs/fuse/fuse_node.c10
-rw-r--r--sys/fs/fuse/fuse_vfsops.c20
-rw-r--r--sys/fs/fuse/fuse_vnops.c48
8 files changed, 84 insertions, 84 deletions
diff --git a/sys/fs/fuse/fuse_debug.h b/sys/fs/fuse/fuse_debug.h
index 3faf372..254e15b 100644
--- a/sys/fs/fuse/fuse_debug.h
+++ b/sys/fs/fuse/fuse_debug.h
@@ -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__)
diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c
index 0efc503..234c7e4 100644
--- a/sys/fs/fuse/fuse_device.c
+++ b/sys/fs/fuse/fuse_device.c
@@ -126,14 +126,14 @@ fuse_device_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
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 fflag, int devtype, struct thread *td)
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, struct uio *uio, int ioflag)
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, struct uio *uio, int ioflag)
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, struct uio *uio, int ioflag)
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, struct uio *uio, int ioflag)
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, struct uio *uio, int ioflag)
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, struct uio *uio, int ioflag)
* 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, struct uio *uio, int ioflag)
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;
}
diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c
index dda9149..4e96edd 100644
--- a/sys/fs/fuse/fuse_file.c
+++ b/sys/fs/fuse/fuse_file.c
@@ -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;
diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c
index 7735329..8525b23 100644
--- a/sys/fs/fuse/fuse_io.c
+++ b/sys/fs/fuse/fuse_io.c
@@ -145,23 +145,23 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag,
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, struct uio *uio,
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, struct uio *uio,
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, struct uio *uio,
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, struct uio *uio,
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, struct uio *uio,
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, struct uio *uio,
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, struct buf *bp)
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, struct buf *bp)
* 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
diff --git a/sys/fs/fuse/fuse_ipc.c b/sys/fs/fuse/fuse_ipc.c
index 52d69b5..a22147e 100644
--- a/sys/fs/fuse/fuse_ipc.c
+++ b/sys/fs/fuse/fuse_ipc.c
@@ -246,7 +246,7 @@ fticket_init(void *mem, int size, int flags)
{
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 ucred *cred)
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)
diff --git a/sys/fs/fuse/fuse_node.c b/sys/fs/fuse/fuse_node.c
index 3838ab7..a77082e 100644
--- a/sys/fs/fuse/fuse_node.c
+++ b/sys/fs/fuse/fuse_node.c
@@ -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, struct ucred *cred)
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, struct ucred *cred)
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, struct ucred *cred, off_t newsize)
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");
diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c
index b8244ec..74e43f0 100644
--- a/sys/fs/fuse/fuse_vfsops.c
+++ b/sys/fs/fuse/fuse_vfsops.c
@@ -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 lkflags, struct vnode **vpp)
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, struct statfs *sbp)
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, struct statfs *sbp)
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,
diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c
index 172210f..75bd2dc 100644
--- a/sys/fs/fuse/fuse_vnops.c
+++ b/sys/fs/fuse/fuse_vnops.c
@@ -219,7 +219,7 @@ fuse_vnop_access(struct vop_access_args *ap)
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 *ap)
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_args *ap)
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_args *ap)
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 *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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 *ap)
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 *ap)
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 *ap)
}
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 *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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_args *ap)
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;
OpenPOWER on IntegriCloud