linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* a (documented) way to get the Ext2+ filesystem size?
@ 2011-08-16 11:37 Ivan Shmakov
  2011-08-16 14:21 ` Jan Kara
  2011-08-17 18:31 ` Ted Ts'o
  0 siblings, 2 replies; 10+ messages in thread
From: Ivan Shmakov @ 2011-08-16 11:37 UTC (permalink / raw)
  To: linux-ext4

	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?

-- 
FSF associate member #7257


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

end of thread, other threads:[~2011-08-19  4:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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