linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ivan Shmakov <oneingray@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: a (documented) way to get the Ext2+ filesystem size?
Date: Tue, 16 Aug 2011 16:21:08 +0200	[thread overview]
Message-ID: <20110816142108.GF23416@quack.suse.cz> (raw)
In-Reply-To: <86aab94mfg.fsf@gray.siamics.net>

On Tue 16-08-11 18:37:23, Ivan Shmakov wrote:
> 	How do I get the Ext2+ filesystem size (in blocks)?
> 
> 	Currently, I do it like:
> 
> static uint_fast64_t
> e2fs_size (ext2_filsys e2)
> {
>   uint_fast32_t hi
>     = (uint_fast32_t)e2->super->s_blocks_count_hi;
>   uint_fast32_t lo
>     = (uint_fast32_t)e2->super->s_blocks_count;
> 
>   /* . */
>   return (((uint64_t)hi << 32) | lo);
> }
> 
> 	However, it seems that there's no documentation for both the
> 	ext2_filsys and struct ext2_super_block structure types, and
> 	their respective member fields.
> 
> 	Am I safe with the code above?
  Yes, this is correct.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2011-08-16 14:21 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 [this message]
2011-08-17 18:31 ` Ted Ts'o
2011-08-17 18:50   ` Ivan Shmakov
2011-08-17 22:09     ` Ted Ts'o
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=20110816142108.GF23416@quack.suse.cz \
    --to=jack@suse.cz \
    --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).