linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Ivan Shmakov <oneingray@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: a (documented) way to get the Ext2+ filesystem size?
Date: Wed, 17 Aug 2011 18:09:53 -0400	[thread overview]
Message-ID: <20110817220953.GD6901@thunk.org> (raw)
In-Reply-To: <86mxf7yirb.fsf@gray.siamics.net>

On Thu, Aug 18, 2011 at 01:50:48AM +0700, Ivan Shmakov wrote:
> >>>>> Ted Ts'o <tytso@mit.edu> writes:
> >>>>> On Tue, Aug 16, 2011 at 06:37:23PM +0700, Ivan Shmakov wrote:
> 
>  >> How do I get the Ext2+ filesystem size (in blocks)?
> 
>  > I assume you need the exact numbers, so you can't use statfs(2)?
>  > What are you using it for?
> 
> 	The intent is to process a filesystem image, not a mounted
> 	filesystem.  It's my understanding that I cannot use neither
> 	statfs(2) nor POSIX' statvfs(2) in this case.
> 
> 	The code I've posted earlier is used in my e2dis [1–3] project.

For this, I'd suggest that you use the ext2fs library.  That will take
care of byte swapping, etc.  It also means that you don't have to
worry about parsing the extent trees.  If you had used the ext2fs
library before ext4 had shipped, you wouldn't have had to make any
changes to support extents, since the ext2fs library wraps and
provides abstract interfaces for most of what you would need for e2dis
project.

Regards,

					- Ted
--
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

  reply	other threads:[~2011-08-17 22:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16 11:37 a (documented) way to get the Ext2+ filesystem size? Ivan Shmakov
2011-08-16 14:21 ` Jan Kara
2011-08-17 18:31 ` Ted Ts'o
2011-08-17 18:50   ` Ivan Shmakov
2011-08-17 22:09     ` Ted Ts'o [this message]
2011-08-18  2:34       ` Steven Liu
2011-08-18  4:25         ` e2dis example usage pattern Ivan Shmakov
2011-08-18  3:49       ` a (documented) way to get the Ext2+ filesystem size? Ivan Shmakov
2011-08-18 21:03         ` Ted Ts'o
2011-08-19  4:34           ` Ivan Shmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110817220953.GD6901@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=oneingray@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).