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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Aug 2011 16:21:08 +0200
From:	Jan Kara <jack@...e.cz>
To:	Ivan Shmakov <oneingray@...il.com>
Cc:	linux-ext4@...r.kernel.org
Subject: Re: a (documented) way to get the Ext2+ filesystem size?

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@...e.cz>
SUSE Labs, CR
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ