From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 6/15] larger b_size, and misc fixlets
Date: Sun, 19 May 2002 12:39:53 -0700 [thread overview]
Message-ID: <3CE7FF89.16AF9B93@zip.com.au> (raw)
Miscellany.
- make the printk in buffer_io_error() sector_t-aware.
- Some buffer.c cleanups from AntonA: remove a couple of !uptodate
checks, and set a new buffer's b_blocknr to -1 in a more sensible
place.
- Make buffer_head.b_size a 32-bit quantity. Needed for 64k pagesize
on ia64. Does not increase sizeof(struct buffer_head).
=====================================
--- 2.5.16/fs/buffer.c~sector_t-printing Sun May 19 11:49:47 2002
+++ 2.5.16-akpm/fs/buffer.c Sun May 19 12:02:57 2002
@@ -179,8 +179,8 @@ __clear_page_buffers(struct page *page)
static void buffer_io_error(struct buffer_head *bh)
{
- printk(KERN_ERR "Buffer I/O error on device %s, logical block %ld\n",
- bdevname(bh->b_bdev), bh->b_blocknr);
+ printk(KERN_ERR "Buffer I/O error on device %s, logical block %Ld\n",
+ bdevname(bh->b_bdev), (u64)bh->b_blocknr);
}
/*
@@ -189,12 +189,12 @@ static void buffer_io_error(struct buffe
*/
void end_buffer_io_sync(struct buffer_head *bh, int uptodate)
{
- if (!uptodate)
- buffer_io_error(bh);
- if (uptodate)
+ if (uptodate) {
set_buffer_uptodate(bh);
- else
+ } else {
+ buffer_io_error(bh);
clear_buffer_uptodate(bh);
+ }
unlock_buffer(bh);
put_bh(bh);
}
@@ -519,14 +519,12 @@ static void end_buffer_async_read(struct
BUG_ON(!buffer_async_read(bh));
- if (!uptodate)
- buffer_io_error(bh);
-
page = bh->b_page;
if (uptodate) {
set_buffer_uptodate(bh);
} else {
clear_buffer_uptodate(bh);
+ buffer_io_error(bh);
SetPageError(page);
}
@@ -579,13 +577,11 @@ static void end_buffer_async_write(struc
BUG_ON(!buffer_async_write(bh));
- if (!uptodate)
- buffer_io_error(bh);
-
page = bh->b_page;
if (uptodate) {
set_buffer_uptodate(bh);
} else {
+ buffer_io_error(bh);
clear_buffer_uptodate(bh);
SetPageError(page);
}
@@ -907,6 +903,7 @@ try_again:
bh->b_bdev = NULL;
bh->b_this_page = head;
+ bh->b_blocknr = -1;
head = bh;
bh->b_state = 0;
@@ -2442,7 +2439,6 @@ static void init_buffer_head(void *data,
struct buffer_head * bh = (struct buffer_head *)data;
memset(bh, 0, sizeof(*bh));
- bh->b_blocknr = -1;
INIT_LIST_HEAD(&bh->b_assoc_buffers);
}
}
--- 2.5.16/include/linux/buffer_head.h~sector_t-printing Sun May 19 11:49:47 2002
+++ 2.5.16-akpm/include/linux/buffer_head.h Sun May 19 12:02:57 2002
@@ -44,7 +44,7 @@ struct buffer_head {
struct page *b_page; /* the page this bh is mapped to */
sector_t b_blocknr; /* block number */
- unsigned short b_size; /* block size */
+ u32 b_size; /* block size */
char *b_data; /* pointer to data block */
struct block_device *b_bdev;
-
next reply other threads:[~2002-05-19 19:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-19 19:39 Andrew Morton [this message]
2002-05-19 22:15 ` Andreas Dilger
2002-05-19 22:53 ` Andrew Morton
2002-05-19 22:59 ` Anton Altaparmakov
[not found] <368842013@toto.iv>
2002-05-20 2:09 ` Peter Chubb
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=3CE7FF89.16AF9B93@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®