dovecot-1.1: HP-UX fs quota: Convert blocks to bytes using files...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 13 00:36:29 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/9ef860a7a9a8
changeset: 7648:9ef860a7a9a8
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 12 23:49:58 2008 +0300
description:
HP-UX fs quota: Convert blocks to bytes using filesystem's actual block size
instead of using a hardcoded DEV_BSIZE (should this be done with other OSes
too?)

diffstat:

1 file changed, 6 insertions(+), 2 deletions(-)
src/plugins/quota/quota-fs.c |    8 ++++++--

diffs (32 lines):

diff -r f7989d01fa3c -r 9ef860a7a9a8 src/plugins/quota/quota-fs.c
--- a/src/plugins/quota/quota-fs.c	Thu Jun 12 23:31:51 2008 +0300
+++ b/src/plugins/quota/quota-fs.c	Thu Jun 12 23:49:58 2008 +0300
@@ -49,6 +49,7 @@ struct fs_quota_mountpoint {
 	char *mount_path;
 	char *device_path;
 	char *type;
+	unsigned int block_size;
 
 #ifdef FS_QUOTA_SOLARIS
 	int fd;
@@ -154,6 +155,7 @@ static struct fs_quota_mountpoint *fs_qu
 	mount->device_path = point.device_path;
 	mount->mount_path = point.mount_path;
 	mount->type = point.type;
+	mount->block_size = point.block_size;
 	return mount;
 }
 
@@ -513,8 +515,10 @@ fs_quota_get_hpux(struct fs_quota_root *
 	}
 
 	if (bytes) {
-		*value_r = (uint64_t)dqblk.dqb_curblocks * DEV_BSIZE;
-		*limit_r = (uint64_t)dqblk.dqb_bsoftlimit * DEV_BSIZE;
+		*value_r = (uint64_t)dqblk.dqb_curblocks *
+			root->mount->block_size;
+		*limit_r = (uint64_t)dqblk.dqb_bsoftlimit *
+			root->mount->block_size;
 	} else {
 		*value_r = dqblk.dqb_curfiles;
 		*limit_r = dqblk.dqb_fsoftlimit;


More information about the dovecot-cvs mailing list