lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20090203203114.GZ28818@webber.adilger.int>
Date:	Tue, 03 Feb 2009 13:31:14 -0700
From:	Andreas Dilger <adilger@....com>
To:	Valerie Aurora Henson <vaurora@...hat.com>
Cc:	linux-ext4@...r.kernel.org, Theodore Tso <tytso@....edu>,
	Nick Dokos <nicholas.dokos@...com>
Subject: Re: Using libext2fs in libe2p?

On Feb 03, 2009  14:56 -0500, Valerie Aurora Henson wrote:
> Possible solutions:
> 
> Link libext2fs with libe2p
> Open code 64-bit block counts
> Require users of libe2p to link with libext2fs
> Move ext2fs_blocks_count() and friends into a header file and inline them

I would probably do the latter.  The functions are small enough that
inlining them is likely equivalent in terms of instructions compared
to jumping to a new function.

> diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
> index 6d2ce70..1923793 100644
> --- a/lib/e2p/ls.c
> +++ b/lib/e2p/ls.c
> @@ -20,6 +20,7 @@
>  #include <time.h>
>  
>  #include "e2p.h"
> +#include "ext2fs/ext2fs.h"
>  
>  static void print_user (unsigned short uid, FILE *f)
>  {
> @@ -219,9 +220,9 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
>         fprintf(f, "Filesystem OS type:       %s\n", str);
>         free(str);
>         fprintf(f, "Inode count:              %u\n", sb->s_inodes_count);
> -       fprintf(f, "Block count:              %u\n", sb->s_blocks_count);
> -       fprintf(f, "Reserved block count:     %u\n", sb->s_r_blocks_count);
> -       fprintf(f, "Free blocks:              %u\n", sb->s_free_blocks_count);
> +       fprintf(f, "Block count:              %llu\n", ext2fs_blocks_count(sb));
> +       fprintf(f, "Reserved block count:     %llu\n", ext2fs_r_blocks_count(sb));
> +       fprintf(f, "Free blocks:              %llu\n", ext2fs_free_blocks_count(sb));
>         fprintf(f, "Free inodes:              %u\n", sb->s_free_inodes_count);
>         fprintf(f, "First block:              %u\n", sb->s_first_data_block);
>         fprintf(f, "Block size:               %u\n", EXT2_BLOCK_SIZE(sb));
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ