Source-Changes-HG archive

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

[src/trunk]: src/sbin/newfs_v7fs Use howmany() macro as it is used in a lot f...



details:   https://anonhg.NetBSD.org/src/rev/96b15224ddf1
branches:  trunk
changeset: 767491:96b15224ddf1
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jul 19 19:57:54 2011 +0000

description:
Use howmany() macro as it is used in a lot fo places in this tool anyway
as suggested by Tsugutomo Enami.

diffstat:

 sbin/newfs_v7fs/main.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 2273121507d2 -r 96b15224ddf1 sbin/newfs_v7fs/main.c
--- a/sbin/newfs_v7fs/main.c    Tue Jul 19 19:57:26 2011 +0000
+++ b/sbin/newfs_v7fs/main.c    Tue Jul 19 19:57:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.5 2011/07/19 18:29:41 joerg Exp $   */
+/*     $NetBSD: main.c,v 1.6 2011/07/19 19:57:54 tron Exp $    */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.5 2011/07/19 18:29:41 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.6 2011/07/19 19:57:54 tron Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -62,8 +62,7 @@
        v7fs_daddr_t ilist_size;
 
        if (files)
-               ilist_size =  (files + V7FS_INODE_PER_BLOCK - 1) /
-                   V7FS_INODE_PER_BLOCK;
+               ilist_size =  howmany(files, V7FS_INODE_PER_BLOCK);
        else
                ilist_size = volume_size / 25; /* 4% */
        if (ilist_size > (v7fs_daddr_t)V7FS_ILISTBLK_MAX)



Home | Main Index | Thread Index | Old Index