Messages in this thread Patch in this message | | | Date | Tue, 24 Aug 1999 15:49:52 +0200 | From | (Lennart Buytenhek) | Subject | [PATCH] cleanup leftover bmap cruft |
| |
Hi all,
this patch cleans up some bmap cruft that wasn't removed in The Great Threading. It's against 2.3.14.
Greetings, Lennert Buytenhek
diff -urN linux-2.3.14/fs/buffer.c linux-2.3.14-new/fs/buffer.c --- linux-2.3.14/fs/buffer.c Mon Aug 23 08:51:16 1999 +++ linux-2.3.14-new/fs/buffer.c Mon Aug 23 08:53:23 1999 @@ -1185,7 +1185,7 @@ goto try_again; } -static int create_page_buffers(int rw, struct page *page, kdev_t dev, int b[], int size, int bmap) +static int create_page_buffers(int rw, struct page *page, kdev_t dev, int b[], int size) { struct buffer_head *head, *bh, *tail; int block; @@ -1213,17 +1213,6 @@ bh->b_dev = dev; bh->b_blocknr = block; - /* - * When we use bmap, we define block zero to represent - * a hole. ll_rw_page, however, may legitimately - * access block zero, and we need to distinguish the - * two cases. - */ - if (bmap && !block) { - memset(bh->b_data, 0, size); - set_bit(BH_Uptodate, &bh->b_state); - continue; - } set_bit(BH_Mapped, &bh->b_state); } tail->b_this_page = head; @@ -1920,7 +1909,7 @@ * FIXME: we need a swapper_inode->get_block function to remove * some of the bmap kludges and interface ugliness here. */ -int brw_page(int rw, struct page *page, kdev_t dev, int b[], int size, int bmap) +int brw_page(int rw, struct page *page, kdev_t dev, int b[], int size) { struct buffer_head *head, *bh, *arr[MAX_BUF_PER_PAGE]; int nr, fresh /* temporary debugging flag */, block; @@ -1934,7 +1923,7 @@ */ fresh = 0; if (!page->buffers) { - create_page_buffers(rw, page, dev, b, size, bmap); + create_page_buffers(rw, page, dev, b, size); fresh = 1; } if (!page->buffers) @@ -1952,16 +1941,9 @@ if (rw == READ) { if (!fresh) BUG(); - if (bmap && !block) { - if (block) - BUG(); - } else { - if (bmap && !block) - BUG(); - if (!buffer_uptodate(bh)) { - arr[nr++] = bh; - atomic_inc(&bh->b_count); - } + if (!buffer_uptodate(bh)) { + arr[nr++] = bh; + atomic_inc(&bh->b_count); } } else { /* WRITE */ if (!bh->b_blocknr) { @@ -1994,6 +1976,7 @@ if (nr && (rw == WRITE)) ll_rw_block(rw, nr, arr); } + return 0; } diff -urN linux-2.3.14/include/linux/fs.h linux-2.3.14-new/include/linux/fs.h --- linux-2.3.14/include/linux/fs.h Mon Aug 23 08:44:23 1999 +++ linux-2.3.14-new/include/linux/fs.h Mon Aug 23 08:53:49 1999 @@ -890,7 +890,7 @@ extern struct buffer_head * bread(kdev_t, int, int); extern struct buffer_head * breada(kdev_t, int, int, unsigned int, unsigned int); -extern int brw_page(int, struct page *, kdev_t, int [], int, int); +extern int brw_page(int, struct page *, kdev_t, int [], int); typedef int (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *); diff -urN linux-2.3.14/mm/page_io.c linux-2.3.14-new/mm/page_io.c --- linux-2.3.14/mm/page_io.c Mon Aug 23 08:51:04 1999 +++ linux-2.3.14-new/mm/page_io.c Mon Aug 23 08:54:03 1999 @@ -125,7 +125,7 @@ set_bit(PG_free_after, &page->flags); /* block_size == PAGE_SIZE/zones_used */ - brw_page(rw, page, dev, zones, block_size, 0); + brw_page(rw, page, dev, zones, block_size); /* Note! For consistency we do all of the logic, * decrementing the page count, and unlocking the page in the
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |