Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CHFS build failure on amd64-current



On Thu, 24 Nov 2011, Hisashi T Fujinaka wrote:

On Thu, 24 Nov 2011, Adam Hoka wrote:

On 11/24/2011 7:25 PM, Hisashi T Fujinaka wrote:
In file included from
/usr/src/sys/ufs/chfs/debug.c:46:0:/usr/src/sys/ufs/chfs/chfs.h: In
function 'chfs_nref_to_vc':
/usr/src/sys/ufs/chfs/chfs.h:531:2: error: format '%llu' expects type
'long long unsigned int', but argument 3 has type 'ino_t'
/usr/src/sys/ufs/chfs/chfs.h:531:2: error: format '%llu' expects type
'long long unsigned int', but argument 4 has type 'ino_t'
/usr/src/sys/ufs/chfs/chfs.h:531:2: error: format '%llu' expects type
'long long unsigned int', but argument 5 has type '__uint64_t'
*** Error code 1



should be fixed, thanks for reporting

Now it's

/usr/src/sys/ufs/chfs/chfs_wbuf.c: In function 'chfs_write_wbuf':/usr/src/sys/ufs/chfs/chfs_wbuf.c:179:3: error: format
'%llu' expects type 'long long unsigned int', but argument 3 has type
'__off_t'

I figured out how you fixed it in chfs.h and found problems in a bunch
of files. The may or may not be correct, but if the attachment doesn't
get stripped, here it is. The files are:

src/sys/ufs/chfs/chfs_build.c
src/sys/ufs/chfs/chfs_gc.c
src/sys/ufs/chfs/chfs_readinode.c
src/sys/ufs/chfs/chfs_scan.c
src/sys/ufs/chfs/chfs_subr.c
src/sys/ufs/chfs/chfs_vfsops.c
src/sys/ufs/chfs/chfs_vnode.c
src/sys/ufs/chfs/chfs_vnops.c
src/sys/ufs/chfs/chfs_wbuf.c
src/sys/ufs/chfs/chfs_write.c

--
Hisashi T Fujinaka - htodd%twofifty.com@localhost
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte
Index: sys/ufs/chfs/chfs_build.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_build.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_build.c
--- sys/ufs/chfs/chfs_build.c   24 Nov 2011 15:51:31 -0000      1.1
+++ sys/ufs/chfs/chfs_build.c   24 Nov 2011 20:15:30 -0000
@@ -90,7 +90,7 @@
 
                        if (child_vc->pvno) {
                                chfs_err("found a hard link: child dir: %s"
-                                   ", (vno: %llu) of dir vno: %llu\n",
+                                   ", (vno: %ju) of dir vno: %ju\n",
                                    fd->name, fd->vno, vc->vno);
                        } else {
                                //dbg("child_vc->pvno =
@@ -119,7 +119,7 @@
        struct chfs_dirent *fd, *tmpfd;
 
        dbg("START\n");
-       dbg("vno: %llu\n", vc->vno);
+       dbg("vno: %ju\n", vc->vno);
 
        nref = vc->dnode;
        KASSERT(mutex_owned(&chmp->chm_lock_mountfields));
@@ -144,8 +144,8 @@
                        struct chfs_vnode_cache *child_vc;
 //                     fd = vc->scan_dirents;
                        dbg("dirent dump:\n");
-                       dbg(" ->vno:     %llu\n", fd->vno);
-                       dbg(" ->version: %llu\n", fd->version);
+                       dbg(" ->vno:     %ju\n", fd->vno);
+                       dbg(" ->version: %ju\n", fd->version);
                        dbg(" ->nhash:   0x%x\n", fd->nhash);
                        dbg(" ->nsize:   %d\n", fd->nsize);
                        dbg(" ->name:    %s\n", fd->name);
@@ -310,7 +310,7 @@
        for (i = 0; i < VNODECACHE_SIZE; i++) {
                vc = chmp->chm_vnocache_hash[i];
                while (vc) {
-                       dbg("vc->vno: %llu\n", vc->vno);
+                       dbg("vc->vno: %ju\n", vc->vno);
                        if (!TAILQ_EMPTY(&vc->scan_dirents))
                                chfs_build_set_vnodecache_nlink(chmp, vc);
                        vc = vc->next;
Index: sys/ufs/chfs/chfs_gc.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_gc.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_gc.c
--- sys/ufs/chfs/chfs_gc.c      24 Nov 2011 15:51:31 -0000      1.1
+++ sys/ufs/chfs/chfs_gc.c      24 Nov 2011 20:13:46 -0000
@@ -208,7 +208,7 @@
        struct vnode *vp = NULL;
        struct chfs_vnode_cache *vc;
        struct chfs_inode *ip;
-       dbg_gc("fetch inode %llu\n", vno);
+       dbg_gc("fetch inode %ju\n", vno);
 
        if (unlinked) {
                dbg_gc("unlinked\n");
@@ -438,7 +438,7 @@
                if (chmp->chm_checked_vno > chmp->chm_max_vno) {
                        mutex_exit(&chmp->chm_lock_sizes);
                        mutex_exit(&chmp->chm_lock_mountfields);
-                       dbg_gc("checked_vno (#%llu) > max_vno (#%llu)\n",
+                       dbg_gc("checked_vno (#%ju) > max_vno (#%ju)\n",
                            chmp->chm_checked_vno, chmp->chm_max_vno);
                        return ENOSPC;
                }
@@ -446,7 +446,7 @@
                mutex_exit(&chmp->chm_lock_sizes);
 
                mutex_enter(&chmp->chm_lock_vnocache);
-               dbg_gc("checking vno #%llu\n", chmp->chm_checked_vno);
+               dbg_gc("checking vno #%ju\n", chmp->chm_checked_vno);
                dbg_gc("get vnode cache\n");
                vc = chfs_vnode_cache_get(chmp, chmp->chm_checked_vno++);
 
@@ -579,7 +579,7 @@
 
        mutex_exit(&chmp->chm_lock_sizes);
 
-       //dbg_gc("enter vnocache lock on #%llu\n", vc->vno);
+       //dbg_gc("enter vnocache lock on #%ju\n", vc->vno);
        mutex_enter(&chmp->chm_lock_vnocache);
 
        dbg_gc("switch\n");
@@ -599,7 +599,7 @@
                mutex_exit(&chmp->chm_lock_vnocache);
                mutex_exit(&chmp->chm_lock_mountfields);
                panic("CHFS BUG - vc state unchecked,"
-                   " checking or gc (vno #%llu, num #%d)\n",
+                   " checking or gc (vno #%ju, num #%d)\n",
                    vc->vno, vc->state);
 
         case VNO_STATE_READING:
@@ -895,7 +895,7 @@
                ret = chfs_gcollect_deletion_dirent(chmp, cheb, ip, fd);
        } else {
                dbg_gc("Nref at leb #%u offset 0x%08x wasn't in node list"
-                   " for ino #%llu\n",
+                   " for ino #%ju\n",
                    nref->nref_lnr, CHFS_GET_OFS(nref->nref_offset), ip->ino);
                if (CHFS_REF_OBSOLETE(nref)) {
                        dbg_gc("But it's obsolete so we don't mind"
Index: sys/ufs/chfs/chfs_readinode.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_readinode.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_readinode.c
--- sys/ufs/chfs/chfs_readinode.c       24 Nov 2011 15:51:31 -0000      1.1
+++ sys/ufs/chfs/chfs_readinode.c       24 Nov 2011 20:15:13 -0000
@@ -391,8 +391,8 @@
                                tmp_td->node->ofs + tmp_td->node->size >= 
end_ofs) {
                                /* New node entirely overlapped by 'this' */
                                if (!chfs_check_td_node(chmp, tmp_td)) {
-                                       dbg("this version: %llu\n", 
tmp_td->version);
-                                       dbg("this ofs: %llu, size: %u\n", 
tmp_td->node->ofs, tmp_td->node->size);
+                                       dbg("this version: %ju\n", 
tmp_td->version);
+                                       dbg("this ofs: %ju, size: %u\n", 
tmp_td->node->ofs, tmp_td->node->size);
                                        dbg("calling kill td 4\n");
                                        chfs_kill_td(chmp, newtd);
                                        return 0;
@@ -895,7 +895,7 @@
                                } else {
                                        if (tmp_td->version > high_ver) {
                                                high_ver = tmp_td->version;
-                                               dbg("highver: %llu\n", 
high_ver);
+                                               dbg("highver: %ju\n", high_ver);
                                                rii->latest_ref = 
tmp_td->node->nref;
                                        }
 
@@ -959,8 +959,8 @@
                break;
        case VNO_STATE_PRESENT:
        case VNO_STATE_READING:
-               chfs_err("Reading inode #%llu in state %d!\n", vc->vno, 
vc->state);
-               chfs_err("wants to read a nonexistent ino %llu\n", vc->vno);
+               chfs_err("Reading inode #%ju in state %d!\n", vc->vno, 
vc->state);
+               chfs_err("wants to read a nonexistent ino %ju\n", vc->vno);
                return ENOENT;
        default:
                panic("BUG() Bad vno cache state.");
Index: sys/ufs/chfs/chfs_scan.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_scan.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_scan.c
--- sys/ufs/chfs/chfs_scan.c    24 Nov 2011 15:51:31 -0000      1.1
+++ sys/ufs/chfs/chfs_scan.c    24 Nov 2011 20:15:49 -0000
@@ -415,7 +415,7 @@
 
        fd->nref->nref_offset = ofs;
 
-       dbg("add dirent to #%llu\n", vc->vno);
+       dbg("add dirent to #%ju\n", vc->vno);
        chfs_add_node_to_list(chmp, vc, fd->nref, &vc->dirents);
        /*tmp = vc->dirents;
          dbg("START|vno: %d dirents dump\n", vc->vno);
Index: sys/ufs/chfs/chfs_subr.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_subr.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_subr.c
--- sys/ufs/chfs/chfs_subr.c    24 Nov 2011 15:51:31 -0000      1.1
+++ sys/ufs/chfs/chfs_subr.c    24 Nov 2011 20:16:07 -0000
@@ -279,7 +279,7 @@
                }
 
                /* create the new data */
-               dbg("create new data vap%llu ip%llu\n", size, ip->size);
+               dbg("create new data vap%ju ip%ju\n", size, ip->size);
                append = size - ip->size;
                if (append > 0) {
                        memcpy(buf, bp->b_data, ip->size);
Index: sys/ufs/chfs/chfs_vfsops.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_vfsops.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_vfsops.c
--- sys/ufs/chfs/chfs_vfsops.c  24 Nov 2011 15:51:32 -0000      1.1
+++ sys/ufs/chfs/chfs_vfsops.c  24 Nov 2011 20:16:30 -0000
@@ -477,7 +477,7 @@
        struct chfs_node_ref* nref = NULL;
        struct buf *bp;
 
-       dbg("vget() | ino: %llu\n", ino);
+       dbg("vget() | ino: %ju\n", ino);
 
        ump = VFSTOUFS(mp);
        dev = ump->um_dev;
@@ -583,7 +583,7 @@
                case VREG:
                case VSOCK:
                        //build the fragtree of the vnode
-                       dbg("read_inode_internal | ino: %llu\n", ip->ino);
+                       dbg("read_inode_internal | ino: %ju\n", ip->ino);
                        error = chfs_read_inode(chmp, ip);
                        if (error) {
                                vput(vp);
@@ -594,7 +594,7 @@
                        break;
                case VLNK:
                        //build the fragtree of the vnode
-                       dbg("read_inode_internal | ino: %llu\n", ip->ino);
+                       dbg("read_inode_internal | ino: %ju\n", ip->ino);
                        error = chfs_read_inode_internal(chmp, ip);
                        if (error) {
                                vput(vp);
@@ -603,7 +603,7 @@
                                return (error);
                        }
 
-                       dbg("size: %llu\n", ip->size);
+                       dbg("size: %ju\n", ip->size);
                        bp = getiobuf(vp, true);
                        bp->b_blkno = 0;
                        bp->b_bufsize = bp->b_resid =
@@ -622,7 +622,7 @@
                case VBLK:
                case VFIFO:
                        //build the fragtree of the vnode
-                       dbg("read_inode_internal | ino: %llu\n", ip->ino);
+                       dbg("read_inode_internal | ino: %ju\n", ip->ino);
                        error = chfs_read_inode_internal(chmp, ip);
                        if (error) {
                                vput(vp);
Index: sys/ufs/chfs/chfs_vnode.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_vnode.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_vnode.c
--- sys/ufs/chfs/chfs_vnode.c   24 Nov 2011 15:51:32 -0000      1.1
+++ sys/ufs/chfs/chfs_vnode.c   24 Nov 2011 20:14:06 -0000
@@ -66,7 +66,7 @@
        char* buf;
        size_t retlen, len;
        struct vnode* vp = NULL;
-       dbg("readvnode | ino: %llu\n", ino);
+       dbg("readvnode | ino: %ju\n", ino);
 
        len = sizeof(struct chfs_flash_vnode);
 
Index: sys/ufs/chfs/chfs_vnops.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_vnops.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_vnops.c
--- sys/ufs/chfs/chfs_vnops.c   24 Nov 2011 15:51:32 -0000      1.1
+++ sys/ufs/chfs/chfs_vnops.c   24 Nov 2011 20:18:55 -0000
@@ -146,7 +146,7 @@
                                goto out;
                        }
 
-                       dbg("vno@allocating new vnode: %llu\n", fd->vno);
+                       dbg("vno@allocating new vnode: %ju\n", fd->vno);
                        error = VFS_VGET(dvp->v_mount, fd->vno, vpp);
                }
        }
@@ -610,7 +610,7 @@
        ioflag = ap->a_ioflag;
        error = 0;
 
-       dbg("ip->size:%llu\n", ip->size);
+       dbg("ip->size:%ju\n", ip->size);
 
 #ifdef DIAGNOSTIC
        if (uio->uio_rw != UIO_READ)
@@ -756,8 +756,8 @@
        uio = ap->a_uio;
        vp = ap->a_vp;
        ip = VTOI(vp);
-       //dbg("file size (vp): %llu\n", vp->v_size);
-       //dbg("file size (ip): %llu\n", ip->i_size);
+       //dbg("file size (vp): %ju\n", vp->v_size);
+       //dbg("file size (ip): %ju\n", ip->i_size);
        ump = ip->ump;
 
        //dbg("uio->resid: %d\n", uio->uio_resid);
@@ -786,8 +786,8 @@
        if (uio->uio_offset < 0 ||
            (u_int64_t)uio->uio_offset +
            uio->uio_resid > ump->um_maxfilesize) {
-               dbg("uio->uio_offset = %lld | uio->uio_offset + "
-                   "uio->uio_resid (%llu) > ump->um_maxfilesize (%lld)\n",
+               dbg("uio->uio_offset = %jd | uio->uio_offset + "
+                   "uio->uio_resid (%ju) > ump->um_maxfilesize (%jd)\n",
                    uio->uio_offset,
                    (u_int64_t)uio->uio_offset + uio->uio_resid,
                    ump->um_maxfilesize);
@@ -979,8 +979,8 @@
        chfs_set_vnode_size(vp, vp->v_size);
 
 
-       //dbg("end file size (vp): %llu\n", vp->v_size);
-       //dbg("end file size (ip): %llu\n", ip->i_size);
+       //dbg("end file size (vp): %ju\n", vp->v_size);
+       //dbg("end file size (ip): %ju\n", ip->i_size);
        KASSERT(vp->v_size == ip->size);
        fstrans_done(vp->v_mount);
 
@@ -1450,7 +1450,7 @@
        struct vnode *vp = ((struct vop_inactive_args *) v)->a_vp;
        struct chfs_inode *ip = VTOI(vp);
        struct chfs_vnode_cache *chvc;
-       dbg("inactive | vno: %llu\n", ip->ino);
+       dbg("inactive | vno: %ju\n", ip->ino);
 
        KASSERT(VOP_ISLOCKED(vp));
 
@@ -1478,7 +1478,7 @@
        struct chfs_mount *chmp = ip->chmp;
        struct chfs_dirent *fd;
 
-       //dbg("reclaim() | ino: %llu\n", ip->ino);
+       //dbg("reclaim() | ino: %ju\n", ip->ino);
        //mutex_enter(&ip->inode_lock);
 
        mutex_enter(&chmp->chm_lock_vnocache);
@@ -1551,7 +1551,7 @@
 /*     dbg("bp dump:\n");
        dbg("   ->b_bcount: %d\n", bp->b_bcount);
        dbg("   ->b_resid:  %d\n", bp->b_resid);
-       dbg("   ->b_blkno:  %llu\n", bp->b_blkno);
+       dbg("   ->b_blkno:  %ju\n", bp->b_blkno);
        dbg("   ->b_error:  %d\n", bp->b_error);*/
        if (read) {
                err = chfs_read_data(chmp, vp, bp);
Index: sys/ufs/chfs/chfs_wbuf.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_wbuf.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_wbuf.c
--- sys/ufs/chfs/chfs_wbuf.c    24 Nov 2011 15:51:32 -0000      1.1
+++ sys/ufs/chfs/chfs_wbuf.c    24 Nov 2011 20:12:46 -0000
@@ -176,7 +176,7 @@
        //dbg("3. wbuf ofs: %zu, len: %zu\n", chmp->chm_wbuf_ofs, 
chmp->chm_wbuf_len);
 
        if (to != PAD(chmp->chm_wbuf_ofs + chmp->chm_wbuf_len)) {
-               dbg("to: %llu != %zu\n", to, PAD(chmp->chm_wbuf_ofs + 
chmp->chm_wbuf_len));
+               dbg("to: %ju != %zu\n", to, PAD(chmp->chm_wbuf_ofs + 
chmp->chm_wbuf_len));
                dbg("Non-contiguous write\n");
                panic("BUG\n");
        }
Index: sys/ufs/chfs/chfs_write.c
===================================================================
RCS file: /home/cvsroot/netbsd/src/sys/ufs/chfs/chfs_write.c,v
retrieving revision 1.1
diff -u -r1.1 chfs_write.c
--- sys/ufs/chfs/chfs_write.c   24 Nov 2011 15:51:32 -0000      1.1
+++ sys/ufs/chfs/chfs_write.c   24 Nov 2011 20:14:41 -0000
@@ -309,7 +309,7 @@
        dnode->node_crc = htole32(crc32(0, (uint8_t *)dnode,
                sizeof(*dnode) - 4));
 
-       dbg("dnode @%llu %ub v%llu\n", dnode->offset, dnode->data_length, 
dnode->version);
+       dbg("dnode @%ju %ub v%ju\n", dnode->offset, dnode->data_length, 
dnode->version);
 
        if (CHFS_PAD(size) - sizeof(*dnode)) {
                tmpbuf = kmem_zalloc(CHFS_PAD(size)


Home | Main Index | Thread Index | Old Index