[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080123140648.788fbc49.akpm@linux-foundation.org>
Date: Wed, 23 Jan 2008 14:06:48 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Theodore Ts'o" <tytso@....EDU>
Cc: linux-kernel@...r.kernel.org, aneesh.kumar@...ux.vnet.ibm.com,
"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 23/49] Add buffer head related helper functions
> On Mon, 21 Jan 2008 22:02:02 -0500 "Theodore Ts'o" <tytso@....EDU> wrote:
> +}
> +EXPORT_SYMBOL(bh_uptodate_or_lock);
> +/**
Missing newline.
> + * bh_submit_read: Submit a locked buffer for reading
> + * @bh: struct buffer_head
> + *
> + * Returns a negative error
> + */
> +int bh_submit_read(struct buffer_head *bh)
> +{
> + if (!buffer_locked(bh))
> + lock_buffer(bh);
> +
> + if (buffer_uptodate(bh))
> + return 0;
Here it can lock the buffer then return zero
> + get_bh(bh);
> + bh->b_end_io = end_buffer_read_sync;
> + submit_bh(READ, bh);
> + wait_on_buffer(bh);
> + if (buffer_uptodate(bh))
> + return 0;
Here it will unlock the buffer and return zero.
This function is unusable when passed an unlocked buffer.
The return value should (always) be documented.
> + return -EIO;
> +}
> +EXPORT_SYMBOL(bh_submit_read);
> void __init buffer_init(void)
Missing newline.
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists