lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH v3] UBIFS: compute KSA size and store in superblock
From
Date
Hi Joel,

still a couple of small requests.

On Wed, 2012-06-06 at 12:03 +0200, Joel Reardon wrote:
> + if (c->use_ubifsec && c->ksa_lebs <
> + ((c->leb_cnt * UBIFS_CRYPTO_KEYSIZE) >> UBIFS_BLOCK_SHIFT) +

Please, do something like this:

min_leb_cnt = (c->leb_cnt * UBIFS_CRYPTO_KEYSIZE) >> UBIFS_BLOCK_SHIFT;
if (c->use_ubifsec && c->ksa_lebs < min_leb_cnt)
bah;
min_leb_cnt += UBIFS_KSA_ADD_LEBS;
if ()
bah;

That would be more readable.

> struct ubifs_sb_node {
> struct ubifs_ch ch;
> @@ -649,7 +652,9 @@ struct ubifs_sb_node {
> __le32 time_gran;
> __u8 uuid[16];
> __le32 ro_compat_version;
> - __u8 padding2[3968];
> + __le32 ksa_lebs;
> + __u8 use_ubifsec;
> + __u8 padding2[3963];
> } __packed;

I've just noticed that we have the 'flags' field ane a set of flags like
"UBIFS_FLG_SPACE_FIXUP". For UBIFSEC, could you please add
"UBIFS_FLG_UBFSEC = 0x8" or you name it. This would be more consistent
way.

--
Best Regards,
Artem Bityutskiy
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-06-07 03:41    [W:0.091 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site