Page MenuHomeFreeBSD

D53132.diff
No OneTemporary

D53132.diff

diff --git a/usr.sbin/quot/quot.8 b/usr.sbin/quot/quot.8
--- a/usr.sbin/quot/quot.8
+++ b/usr.sbin/quot/quot.8
@@ -35,7 +35,7 @@
.Nd display disk space occupied by each user
.Sh SYNOPSIS
.Nm
-.Op Fl cfhknv
+.Op Fl cfknv
.Op Fl a | Ar filesystem ...
.Sh DESCRIPTION
The
@@ -53,10 +53,6 @@
blocks in files with this or lower size.
.It Fl f
For each user, display count of files and space occupied.
-.It Fl h
-Estimate the number of blocks in each file based on its size.
-Note that this does not account for sparse files and is no faster than
-reporting the accurate block count.
.It Fl k
Force the numbers to be reported in kilobyte counts.
By default, all sizes are reported in 512-byte block counts.
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -55,7 +55,6 @@
/* some flags of what to do: */
static bool all;
static bool count;
-static bool estimate;
static bool unused;
static void (*func)(int, struct fs *);
static long blocksize;
@@ -63,7 +62,6 @@
static int headerlen;
static union dinode *get_inode(int, struct fs *, ino_t);
-static int virtualblocks(struct fs *, union dinode *);
static int isfree(struct fs *, union dinode *);
static void inituser(void);
static void usrrehash(void);
@@ -149,33 +147,9 @@
return ((union dinode *)di2);
}
-#define actualblocks(fs, dp) DIP(fs, dp, di_blocks)
-
-static int virtualblocks(struct fs *super, union dinode *dp)
-{
- off_t nblk, sz;
-
- sz = DIP(super, dp, di_size);
-
- if (lblkno(super, sz) >= UFS_NDADDR) {
- nblk = blkroundup(super, sz);
- sz = lblkno(super, nblk);
- sz = (sz - UFS_NDADDR + NINDIR(super) - 1) / NINDIR(super);
- while (sz > 0) {
- nblk += sz * super->fs_bsize;
- /* sz - 1 rounded up */
- sz = (sz - 1 + NINDIR(super) - 1) / NINDIR(super);
- }
- } else
- nblk = fragroundup(super, sz);
-
- return nblk / 512;
-}
-
static int
isfree(struct fs *super, union dinode *dp)
{
-
switch (DIP(super, dp, di_mode) & IFMT) {
case IFIFO:
case IFLNK: /* should check FASTSYMLINK? */
@@ -337,8 +311,7 @@
if ((dp = get_inode(fd, super, inode)) != NULL &&
!isfree(super, dp)
) {
- sz = estimate ? virtualblocks(super, dp) :
- actualblocks(super, dp);
+ sz = DIP(super, dp, di_blocks);
ksz = SIZE(sz);
for (fsp = &fsizes; (fp = *fsp); fsp = &fp->fsz_next) {
if (ksz < fp->fsz_last)
@@ -386,8 +359,7 @@
if ((dp = get_inode(fd, super, inode)) != NULL &&
!isfree(super, dp)) {
uses(DIP(super, dp, di_uid),
- estimate ? virtualblocks(super, dp) :
- actualblocks(super, dp),
+ DIP(super, dp, di_blocks),
DIP(super, dp, di_atime));
}
}
@@ -454,7 +426,7 @@
static void
usage(void)
{
- fprintf(stderr, "usage: quot [-cfhknv] [-a | filesystem ...]\n");
+ fprintf(stderr, "usage: quot [-cfknv] [-a | filesystem ...]\n");
exit(1);
}
@@ -514,7 +486,7 @@
count = true;
break;
case 'h':
- estimate = true;
+ /* ignored for backward compatibility */
break;
case 'k':
blocksize = 1024;

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 22, 2:27 AM (22 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31947402
Default Alt Text
D53132.diff (2 KB)

Event Timeline