linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: cmm@us.ibm.com
Cc: linux-fsdevel@vger.kernel.org, ext2-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/9]ext4 super block changes for >32 bit blocks numbers
Date: Wed, 9 Aug 2006 23:41:05 -0700	[thread overview]
Message-ID: <20060809234105.67414f03.akpm@osdl.org> (raw)
In-Reply-To: <1155172945.3161.88.camel@localhost.localdomain>

On Wed, 09 Aug 2006 18:22:25 -0700
Mingming Cao <cmm@us.ibm.com> wrote:

> In-kernel and on-disk super block changes to support >32 bit blocks numbers.
> 
> +static inline u32 EXT4_RELATIVE_ENCODE(ext4_fsblk_t group_base,
> +				       ext4_fsblk_t fs_block)
> +{
> +	s32 gdp_block;
> +
> +	if (fs_block < (1ULL<<32) && group_base < (1ULL<<32))
> +		return fs_block;
> +
> +	gdp_block = (fs_block - group_base);
> +	BUG_ON ((group_base + gdp_block) != fs_block);
> +
> +	return gdp_block;
> +}
> +
> +static inline ext4_fsblk_t EXT4_RELATIVE_DECODE(ext4_fsblk_t group_base,
> +						u32 gdp_block)
> +{
> +	if (group_base >= (1ULL<<32))
> +		return group_base + (s32) gdp_block;
> +
> +	if ((s32) gdp_block >= 0 && gdp_block < group_base &&
> +		  group_base + gdp_block >= (1ULL<<32))
> +		return group_base + gdp_block;
> +
> +	return gdp_block;
> +}

These seem far too large and far too commonly called to be inlined.

>  
> +
> +#define EXT4_BLOCKS_COUNT(s)	\
> +	(ext4_fsblk_t)(((__u64)le32_to_cpu((s)->s_blocks_count_hi) << 32) |	\
> +	 	(__u64)le32_to_cpu((s)->s_blocks_count))
> +#define EXT4_BLOCKS_COUNT_SET(s,v)	do {				\
> +	(s)->s_blocks_count = cpu_to_le32((v));				\
> +	(s)->s_blocks_count_hi = cpu_to_le32(((__u64)(v)) >> 32);	\
> +} while (0)
> +
> +#define EXT4_R_BLOCKS_COUNT(s)	\
> +	(ext4_fsblk_t)(((__u64)le32_to_cpu((s)->s_r_blocks_count_hi) << 32) |	\
> +		 (__u64)le32_to_cpu((s)->s_r_blocks_count))
> +#define EXT4_R_BLOCKS_COUNT_SET(s,v)	do {				\
> +	(s)->s_r_blocks_count = cpu_to_le32((v));			\
> +	(s)->s_r_blocks_count_hi = cpu_to_le32(((__u64)(v)) >> 32);	\
> +} while (0)
> +
> +#define EXT4_FREE_BLOCKS_COUNT(s)					\
> +	(ext4_fsblk_t)(((__u64)le32_to_cpu((s)->s_free_blocks_count_hi) << 32) | \
> +		 (__u64)le32_to_cpu((s)->s_free_blocks_count))
> +#define EXT4_FREE_BLOCKS_COUNT_SET(s,v)	do {				\
> +	(s)->s_free_blocks_count = cpu_to_le32((v));			\
> +	(s)->s_free_blocks_count_hi = cpu_to_le32(((__u64)(v)) >> 32);	\
> +} while (0)

Can these not be implemented as C functions?


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

  reply	other threads:[~2006-08-10  6:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-10  1:22 [PATCH 9/9]ext4 super block changes for >32 bit blocks numbers Mingming Cao
2006-08-10  6:41 ` Andrew Morton [this message]
2006-08-10 17:28   ` Mingming Cao
2006-08-24  0:28   ` [Ext2-devel] " Avantika Mathur LTC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060809234105.67414f03.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=cmm@us.ibm.com \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).