linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using libext2fs in libe2p?
@ 2009-02-03 19:56 Valerie Aurora Henson
  2009-02-03 20:31 ` Andreas Dilger
  2009-02-03 21:06 ` Theodore Tso
  0 siblings, 2 replies; 3+ messages in thread
From: Valerie Aurora Henson @ 2009-02-03 19:56 UTC (permalink / raw)
  To: linux-ext4; +Cc: Theodore Tso, Nick Dokos

Nick Dokos noticed that libe2p now depends on libext2fs in the 64-bit
tree, since we use ext2fs_blocks_count() and friends (see diff below).

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 am agnostic.

-VAL

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));


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Using libext2fs in libe2p?
  2009-02-03 19:56 Using libext2fs in libe2p? Valerie Aurora Henson
@ 2009-02-03 20:31 ` Andreas Dilger
  2009-02-03 21:06 ` Theodore Tso
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Dilger @ 2009-02-03 20:31 UTC (permalink / raw)
  To: Valerie Aurora Henson; +Cc: linux-ext4, Theodore Tso, Nick Dokos

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@vger.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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using libext2fs in libe2p?
  2009-02-03 19:56 Using libext2fs in libe2p? Valerie Aurora Henson
  2009-02-03 20:31 ` Andreas Dilger
@ 2009-02-03 21:06 ` Theodore Tso
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Tso @ 2009-02-03 21:06 UTC (permalink / raw)
  To: Valerie Aurora Henson; +Cc: linux-ext4, Nick Dokos

On Tue, Feb 03, 2009 at 02:56:45PM -0500, Valerie Aurora Henson wrote:
> Nick Dokos noticed that libe2p now depends on libext2fs in the 64-bit
> tree, since we use ext2fs_blocks_count() and friends (see diff below).

Fixed already in my rebased version of your patches:  

    http://github.com/tytso/e2fsprogs-64bit/tree/master
    git://github.com/tytso/e2fsprogs-64bit.git

> 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 chose door #2.  Actually, I created new static functions in
lib/e2p/ls.c, named e2p_*_blocks_count().  It's in the patch:
Add-e2p-64bit-blocks-support.

Note: my patchset (which is against e2fsprogs 1.41.4 at the moment)
still has regression test failures, and I have done *zero* testing on
64-bit filesystems.  Hopefully Val can help me with that; the updated,
rebase patchset is the first step towards getting these commits merged
into e2fsprogs mainline.

						- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-03 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 19:56 Using libext2fs in libe2p? Valerie Aurora Henson
2009-02-03 20:31 ` Andreas Dilger
2009-02-03 21:06 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).