Date: Wed, 17 Dec 2014 07:27:20 +0000 (UTC) From: Gleb Kurtsou <gleb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275856 - in head/sys: compat/linprocfs compat/svr4 dev/drm dev/drm2 fs/ext2fs kern security/mac_lomac ufs/ffs ufs/ufs Message-ID: <201412170727.sBH7RKHt009640@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gleb Date: Wed Dec 17 07:27:19 2014 New Revision: 275856 URL: https://svnweb.freebsd.org/changeset/base/275856 Log: Adjust printf format specifiers for dev_t and ino_t in kernel. ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/svr4/svr4_socket.c head/sys/dev/drm/drm_sysctl.c head/sys/dev/drm2/drm_sysctl.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/kern/kern_conf.c head/sys/security/mac_lomac/mac_lomac.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/compat/linprocfs/linprocfs.c Wed Dec 17 07:27:19 2014 (r275856) @@ -674,7 +674,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) PS_ADD("pgrp", "%d", p->p_pgid); PS_ADD("session", "%d", p->p_session->s_sid); PROC_UNLOCK(p); - PS_ADD("tty", "%d", kp.ki_tdev); + PS_ADD("tty", "%ju", (uintmax_t)kp.ki_tdev); PS_ADD("tpgid", "%d", kp.ki_tpgid); PS_ADD("flags", "%u", 0); /* XXX */ PS_ADD("minflt", "%lu", kp.ki_rusage.ru_minflt); Modified: head/sys/compat/svr4/svr4_socket.c ============================================================================== --- head/sys/compat/svr4/svr4_socket.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/compat/svr4/svr4_socket.c Wed Dec 17 07:27:19 2014 (r275856) @@ -93,7 +93,8 @@ svr4_find_socket(td, fp, dev, ino, saun) struct svr4_sockcache_entry *e; void *cookie = ((struct socket *)fp->f_data)->so_emuldata; - DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino)); + DPRINTF(("svr4_find_socket: [%p,%ju,%ju]: ", td, (uintmax_t)dev, + (uintmax_t)ino)); mtx_lock(&svr4_sockcache_lock); TAILQ_FOREACH(e, &svr4_head, entries) if (e->p == td->td_proc && e->dev == dev && e->ino == ino) { @@ -142,8 +143,8 @@ svr4_add_socket(td, path, st) mtx_lock(&svr4_sockcache_lock); TAILQ_INSERT_HEAD(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); - DPRINTF(("svr4_add_socket: %s [%p,%d,%d]\n", e->sock.sun_path, - td->td_proc, e->dev, e->ino)); + DPRINTF(("svr4_add_socket: %s [%p,%ju,%ju]\n", e->sock.sun_path, + td->td_proc, (uintmax_t)e->dev, (uintmax_t)e->ino)); return 0; } @@ -160,8 +161,9 @@ svr4_delete_socket(p, fp) if (e->p == p && e->cookie == cookie) { TAILQ_REMOVE(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); - DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n", - e->sock.sun_path, p, (int)e->dev, e->ino)); + DPRINTF(("svr4_delete_socket: %s [%p,%ju,%ju]\n", + e->sock.sun_path, p, (uintmax_t)e->dev, + (uintmax_t)e->ino)); free(e, M_TEMP); return; } @@ -179,8 +181,9 @@ svr4_purge_sockcache(arg, p) TAILQ_FOREACH_SAFE(e, &svr4_head, entries, ne) { if (e->p == p) { TAILQ_REMOVE(&svr4_head, e, entries); - DPRINTF(("svr4_purge_sockcache: %s [%p,%d,%d]\n", - e->sock.sun_path, p, (int)e->dev, e->ino)); + DPRINTF(("svr4_purge_sockcache: %s [%p,%ju,%ju]\n", + e->sock.sun_path, p, (uintmax_t)e->dev, + (uintmax_t)e->ino)); free(e, M_TEMP); } } Modified: head/sys/dev/drm/drm_sysctl.c ============================================================================== --- head/sys/dev/drm/drm_sysctl.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/dev/drm/drm_sysctl.c Wed Dec 17 07:27:19 2014 (r275856) @@ -137,8 +137,9 @@ static int drm_name_info DRM_SYSCTL_HAND int retcode; int hasunique = 0; - DRM_SYSCTL_PRINT("%s 0x%x", dev->driver->name, dev2udev(dev->devnode)); - + DRM_SYSCTL_PRINT("%s 0x%jx", dev->driver->name, + (uintmax_t)dev2udev(dev->devnode)); + DRM_LOCK(); if (dev->unique) { snprintf(buf, sizeof(buf), " %s", dev->unique); Modified: head/sys/dev/drm2/drm_sysctl.c ============================================================================== --- head/sys/dev/drm2/drm_sysctl.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/dev/drm2/drm_sysctl.c Wed Dec 17 07:27:19 2014 (r275856) @@ -155,7 +155,8 @@ static int drm_name_info DRM_SYSCTL_HAND int retcode; int hasunique = 0; - DRM_SYSCTL_PRINT("%s 0x%x", dev->driver->name, dev2udev(dev->devnode)); + DRM_SYSCTL_PRINT("%s 0x%jx", dev->driver->name, + (uintmax_t)dev2udev(dev->devnode)); DRM_LOCK(dev); if (dev->unique) { Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 17 07:27:19 2014 (r275856) @@ -264,8 +264,8 @@ ext2_reallocblks(struct vop_reallocblks_ * with the file. */ #ifdef DEBUG - printf("realloc: ino %d, lbns %jd-%jd\n\told:", ip->i_number, - (intmax_t)start_lbn, (intmax_t)end_lbn); + printf("realloc: ino %ju, lbns %jd-%jd\n\told:", + (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); #endif /* DEBUG */ blkno = newblk; for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { @@ -968,8 +968,8 @@ ext2_blkfree(struct inode *ip, e4fs_dadd ump = ip->i_ump; cg = dtog(fs, bno); if ((u_int)bno >= fs->e2fs->e2fs_bcount) { - printf("bad block %lld, ino %llu\n", (long long)bno, - (unsigned long long)ip->i_number); + printf("bad block %lld, ino %ju\n", (long long)bno, + (uintmax_t)ip->i_number); ext2_fserr(fs, ip->i_uid, "bad block"); return; } Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed Dec 17 07:27:19 2014 (r275856) @@ -801,11 +801,13 @@ ext2_dirbad(struct inode *ip, doff_t off mp = ITOV(ip)->v_mount; if ((mp->mnt_flag & MNT_RDONLY) == 0) - panic("ext2_dirbad: %s: bad dir ino %lu at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (u_long)ip->i_number,(long)offset, how); + panic("ext2_dirbad: %s: bad dir ino %ju at offset %ld: %s\n", + mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + (long)offset, how); else - (void)printf("%s: bad dir ino %lu at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how); + (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", + mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + (long)offset, how); } Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Dec 17 07:27:19 2014 (r275856) @@ -1366,7 +1366,7 @@ ext2_print(struct vop_print_args *ap) struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - vn_printf(ip->i_devvp, "\tino %lu", (u_long)ip->i_number); + vn_printf(ip->i_devvp, "\tino %ju", (uintmax_t)ip->i_number); if (vp->v_type == VFIFO) fifo_printinfo(vp); printf("\n"); Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/kern/kern_conf.c Wed Dec 17 07:27:19 2014 (r275856) @@ -1292,7 +1292,8 @@ clone_cleanup(struct clonedevs **cdp) if (!(cp->cdp_flags & CDP_SCHED_DTR)) { cp->cdp_flags |= CDP_SCHED_DTR; KASSERT(dev->si_flags & SI_NAMED, - ("Driver has goofed in cloning underways udev %x unit %x", dev2udev(dev), dev2unit(dev))); + ("Driver has goofed in cloning underways udev %jx unit %x", + (uintmax_t)dev2udev(dev), dev2unit(dev))); destroy_devl(dev); } } Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/security/mac_lomac/mac_lomac.c Wed Dec 17 07:27:19 2014 (r275856) @@ -559,11 +559,11 @@ maybe_demote(struct mac_lomac *subjlabel pgid = p->p_pgrp->pg_id; /* XXX could be stale? */ if (vp != NULL && VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" - " level %s after %s a level-%s %s (inode=%ld, " + " level %s after %s a level-%s %s (inode=%ju, " "mountpount=%s)\n", subjlabeltext, p->p_pid, pgid, curthread->td_ucred->cr_uid, p->p_comm, subjtext, actionname, objlabeltext, objname, - va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); + (uintmax_t)va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); } else { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" " level %s after %s a level-%s %s\n", Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Dec 17 07:27:19 2014 (r275856) @@ -845,7 +845,7 @@ ffs_reallocblks_ufs2(ap) */ #ifdef DEBUG if (prtrealloc) - printf("realloc: ino %d, lbns %jd-%jd\n\told:", ip->i_number, + printf("realloc: ino %ju, lbns %jd-%jd\n\told:", (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); #endif blkno = newblk; @@ -1029,8 +1029,8 @@ retry: ip = VTOI(*vpp); if (ip->i_mode) { dup_alloc: - printf("mode = 0%o, inum = %lu, fs = %s\n", - ip->i_mode, (u_long)ip->i_number, fs->fs_fsmnt); + printf("mode = 0%o, inum = %ju, fs = %s\n", + ip->i_mode, (uintmax_t)ip->i_number, fs->fs_fsmnt); panic("ffs_valloc: dup alloc"); } if (DIP(ip, i_blocks) && (fs->fs_flags & FS_UNCLEAN) == 0) { /* XXX */ Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Wed Dec 17 07:10:48 2014 (r275855) +++ head/sys/ufs/ufs/ufs_lookup.c Wed Dec 17 07:27:19 2014 (r275856) @@ -1475,7 +1475,8 @@ ufs_checkpath(ino_t source_ino, ino_t pa } } KASSERT(dd_ino == VTOI(vp1)->i_number, - ("directory %d reparented\n", VTOI(vp1)->i_number)); + ("directory %ju reparented\n", + (uintmax_t)VTOI(vp1)->i_number)); if (vp != tvp) vput(vp); vp = vp1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412170727.sBH7RKHt009640>