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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Aug 2011 18:37:23 +0700
From:	Ivan Shmakov <ivan@...y.siamics.net>
To:	linux-ext4@...r.kernel.org
Subject: a (documented) way to get the Ext2+ filesystem size? 

	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

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