linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/16] GFS2: Directory handling
Date: Fri, 21 Apr 2006 17:16:36 +0100	[thread overview]
Message-ID: <20060421161636.GA15311@infradead.org> (raw)
In-Reply-To: <1145636178.3856.106.camel@quoit.chygwyn.com>

> +/*
> +* Implements Extendible Hashing as described in:
> +*   "Extendible Hashing" by Fagin, et al in
> +*     __ACM Trans. on Database Systems__, Sept 1979.
> +*
> +*

please follow the normal comment style, that is leave a space before the *
for block comments so it lines up nicely with the * in the start tag.

> +#include <linux/sched.h>
> +#include <linux/slab.h>
> +#include <linux/spinlock.h>
> +#include <linux/completion.h>

you don't seem to be using any completion in this file

> +#include <linux/buffer_head.h>
> +#include <linux/sort.h>
> +#include <linux/gfs2_ondisk.h>
> +#include <linux/crc32.h>
> +#include <linux/vmalloc.h>
> +#include <asm/semaphore.h>

you're not using any semaphore in this file

> +int gfs2_dir_get_buffer(struct gfs2_inode *ip, uint64_t block, int new,
> +		         struct buffer_head **bhp)
> +{
> +	struct buffer_head *bh;
> +	int error = 0;
> +
> +	if (new) {
> +		bh = gfs2_meta_new(ip->i_gl, block);
> +		gfs2_trans_add_bh(ip->i_gl, bh, 1);
> +		gfs2_metatype_set(bh, GFS2_METATYPE_JD, GFS2_FORMAT_JD);
> +		gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
> +	} else {
> +		error = gfs2_meta_read(ip->i_gl, block, DIO_START | DIO_WAIT,
> +				       &bh);
> +		if (error)
> +			return error;
> +		if (gfs2_metatype_check(ip->i_sbd, bh, GFS2_METATYPE_JD)) {
> +			brelse(bh);
> +			return -EIO;
> +		}
> +	}
> +
> +	*bhp = bh;
> +	return 0;

the code is completely different for the new vs !new case, so there's no
point in merging it to a single function.


  reply	other threads:[~2006-04-21 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 16:16 [PATCH 07/16] GFS2: Directory handling Steven Whitehouse
2006-04-21 16:16 ` Christoph Hellwig [this message]
2006-04-24  9:16   ` Steven Whitehouse

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=20060421161636.GA15311@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    /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).