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]
Message-ID: <AANLkTinJJG0K=BPS0CPzDWcgpRn_yPxZ819N408SwD6d@mail.gmail.com>
Date:	Mon, 8 Nov 2010 08:49:54 +0100
From:	Marco Stornelli <marco.stornelli@...il.com>
To:	Ryan Mallon <ryan@...ewatersys.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	Linux Embedded <linux-embedded@...r.kernel.org>,
	Linux FS Devel <linux-fsdevel@...r.kernel.org>,
	Tim Bird <tim.bird@...sony.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 08/16 v2] pramfs: headers

2010/11/7 Ryan Mallon <ryan@...ewatersys.com>:
> On 11/06/2010 09:58 PM, Marco Stornelli wrote:
>> From: Marco Stornelli <marco.stornelli@...il.com>
>>
>> Definitions for the PRAMFS filesystem.
>>
>> Signed-off-by: Marco Stornelli <marco.stornelli@...il.com>
>> ---
>> diff -Nurp linux-2.6.36-orig/fs/pramfs/pram.h linux-2.6.36/fs/pramfs/pram.h
>> --- linux-2.6.36-orig/fs/pramfs/pram.h        1970-01-01 01:00:00.000000000 +0100
>> +++ linux-2.6.36/fs/pramfs/pram.h     2010-10-30 12:02:45.000000000 +0200
>> @@ -0,0 +1,317 @@
>
>> +/*
>> + * Structure of the super block in PRAMFS
>> + */
>> +struct pram_super_block {
>> +     __be16  s_sum;          /* checksum of this sb, including padding */
>> +     __be64  s_size;         /* total size of fs in bytes */
>> +     __be32  s_blocksize;    /* blocksize in bytes */
>> +     __be32  s_inodes_count; /* total inodes count (used or free) */
>> +     __be32  s_free_inodes_count;/* free inodes count */
>> +     __be32  s_free_inode_hint;  /* start hint for locating free inodes */
>> +     __be32  s_blocks_count; /* total data blocks count (used or free) */
>> +     __be32  s_free_blocks_count;/* free data blocks count */
>> +     __be32  s_free_blocknr_hint;/* free data blocks count */
>> +     __be64  s_bitmap_start; /* data block in-use bitmap location */
>> +     __be32  s_bitmap_blocks;/* size of bitmap in number of blocks */
>> +     __be32  s_mtime;        /* Mount time */
>> +     __be32  s_wtime;        /* Write time */
>> +     __be16  s_magic;        /* Magic signature */
>> +     char    s_volume_name[16]; /* volume name */
>> +};
>
> Is there a particular reason to use big endian types for the data
> structures? On a little endian machine you will end up converting values
> everywhere. I assume that you don't expect the machine to change
> endianess between reboots :-). If this is for generating/reading
> filesystems from userspace, wouldn't it be better to have the userspace
> tools specify the target endianess and do the conversions there?
>
> ~Ryan

Yes, there is a reason. In the first review a comment was: the fs must
have a fix endianess layout. This fs is designed for the embedded
world mainly. Since most of cpus used in this case are big-endian, it
means that for typical use case, there is no cost for endianess
conversion.

Marco
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ