lkml.org 
[lkml]   [2008]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 30/49] ext4: Convert truncate_mutex to read write semaphore.
On Wed, Jan 23, 2008 at 02:06:59PM -0800, Andrew Morton wrote:
> > On Mon, 21 Jan 2008 22:02:09 -0500 "Theodore Ts'o" <tytso@MIT.EDU> wrote:
> > +int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
> > + unsigned long max_blocks, struct buffer_head *bh,
> > + int create, int extend_disksize)
> > +{
> > + int retval;
> > + if (create) {
> > + down_write((&EXT4_I(inode)->i_data_sem));
> > + } else {
> > + down_read((&EXT4_I(inode)->i_data_sem));
> > + }
> > + if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {
> > + retval = ext4_ext_get_blocks(handle, inode, block, max_blocks,
> > + bh, create, extend_disksize);
> > + } else {
> > + retval = ext4_get_blocks_handle(handle, inode, block,
> > + max_blocks, bh, create, extend_disksize);
> > + }
> > + if (create) {
> > + up_write((&EXT4_I(inode)->i_data_sem));
> > + } else {
> > + up_read((&EXT4_I(inode)->i_data_sem));
> > + }
>
> This function has many unneeded braces. checkpatch used to detect this
> but it seems to have broken.

This is a side effect of this rule:

This does not apply if one branch of a conditional statement
is a single statement. Use braces in both branches.

Basically each arm is being considered in isolation, each arm is seen as
having a "sibling" arm with braces so it is permitted to have braces.
Bugger.

I guess I'll try and see if I can detect this.

> > + return retval;
> > +}
> > static int ext4_get_block(struct inode *inode, sector_t iblock,
> > struct buffer_head *bh_result, int create)
>
> Mising newline.

We could check for those ... will look to add in the next release.

-apw


\
 
 \ /
  Last update: 2008-01-24 14:03    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site