The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 9/27] remove swap_get_block()
Date: Thu, 04 Jul 2002 16:54:14 -0700	[thread overview]
Message-ID: <3D24E026.796D9D0E@zip.com.au> (raw)



Patch from Christoph Hellwig removes swap_get_block().

I was sort-of hanging onto this function because it is a standard
get_block function, and maybe perhaps it could be used to make swap use
the regular filesystem I/O functions.  We don't want to do that, so
kill it.




 page_io.c |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)

--- 2.5.24/mm/page_io.c~kill-swap_get_block	Thu Jul  4 16:17:15 2002
+++ 2.5.24-akpm/mm/page_io.c	Thu Jul  4 16:17:15 2002
@@ -15,37 +15,26 @@
 #include <linux/pagemap.h>
 #include <linux/swap.h>
 #include <linux/bio.h>
-#include <linux/buffer_head.h>
-#include <asm/pgtable.h>
 #include <linux/swapops.h>
-
-static int
-swap_get_block(struct inode *inode, sector_t iblock,
-		struct buffer_head *bh_result, int create)
-{
-	struct swap_info_struct *sis;
-	swp_entry_t entry;
-
-	entry.val = iblock;
-	sis = get_swap_info_struct(swp_type(entry));
-	bh_result->b_bdev = sis->bdev;
-	bh_result->b_blocknr = map_swap_page(sis, swp_offset(entry));
-	bh_result->b_size = PAGE_SIZE;
-	set_buffer_mapped(bh_result);
-	return 0;
-}
+#include <linux/buffer_head.h>	/* for block_sync_page() */
+#include <asm/pgtable.h>
 
 static struct bio *
 get_swap_bio(int gfp_flags, struct page *page, bio_end_io_t end_io)
 {
 	struct bio *bio;
-	struct buffer_head bh;
 
 	bio = bio_alloc(gfp_flags, 1);
 	if (bio) {
-		swap_get_block(NULL, page->index, &bh, 1);
-		bio->bi_sector = bh.b_blocknr * (PAGE_SIZE >> 9);
-		bio->bi_bdev = bh.b_bdev;
+		struct swap_info_struct *sis;
+		swp_entry_t entry;
+
+		entry.val = page->index;
+		sis = get_swap_info_struct(swp_type(entry));
+
+		bio->bi_sector = map_swap_page(sis, swp_offset(entry)) *
+					(PAGE_SIZE >> 9);
+		bio->bi_bdev = sis->bdev;
 		bio->bi_io_vec[0].bv_page = page;
 		bio->bi_io_vec[0].bv_len = PAGE_SIZE;
 		bio->bi_io_vec[0].bv_offset = 0;

-

                 reply	other threads:[~2002-07-04 23:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3D24E026.796D9D0E@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