public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jose R. Santos" <jrs@us.ibm.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: [RFC PATCH 2/3][e2fsprogs] Add {read,write}_blk64 to unix_io.c
Date: Mon, 03 Mar 2008 10:41:24 -0600	[thread overview]
Message-ID: <20080303164124.5557.52087.stgit@gara> (raw)
In-Reply-To: <20080303164113.5557.68102.stgit@gara>

From: Jose R. Santos <jrs@us.ibm.com>

Add {read,write}_blk64 to unix_io.c

Add 64-bit block capable routines to Unix IO manager.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
--

 lib/ext2fs/unix_io.c |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 8497a41..eedbcdb 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -88,7 +88,11 @@ static errcode_t unix_set_option(io_channel channel, const char *option,
 static errcode_t unix_get_stats(io_channel channel, io_stats *stats)
 ;
 static void reuse_cache(io_channel channel, struct unix_private_data *data,
-		 struct unix_cache *cache, unsigned long block);
+		 struct unix_cache *cache, unsigned long long block);
+static errcode_t unix_read_blk64(io_channel channel, unsigned long long block,
+			       int count, void *data);
+static errcode_t unix_write_blk64(io_channel channel, unsigned long long block,
+				int count, const void *data);
 
 /* __FreeBSD_kernel__ is defined by GNU/kFreeBSD - the FreeBSD kernel
  * does not know buffered block devices - everything is raw. */
@@ -114,6 +118,8 @@ static struct struct_io_manager struct_unix_manager = {
 #endif
 	unix_set_option,
 	unix_get_stats,
+	unix_read_blk64,
+	unix_write_blk64,
 };
 
 io_manager unix_io_manager = &struct_unix_manager;
@@ -140,7 +146,7 @@ static errcode_t unix_get_stats(io_channel channel, io_stats *stats)
 #ifndef NEED_BOUNCE_BUFFER
 static errcode_t raw_read_blk(io_channel channel,
 			      struct unix_private_data *data,
-			      unsigned long block,
+			      unsigned long long block,
 			      int count, void *buf)
 {
 	errcode_t	retval;
@@ -229,7 +235,7 @@ error_out:
 
 static errcode_t raw_write_blk(io_channel channel,
 			       struct unix_private_data *data,
-			       unsigned long block,
+			       unsigned long long block,
 			       int count, const void *buf)
 {
 	ssize_t		size;
@@ -318,7 +324,7 @@ static void free_cache(struct unix_private_data *data)
  * entry to that should be reused.
  */
 static struct unix_cache *find_cached_block(struct unix_private_data *data,
-					    unsigned long block,
+					    unsigned long long block,
 					    struct unix_cache **eldest)
 {
 	struct unix_cache	*cache, *unused_cache, *oldest_cache;
@@ -348,7 +354,7 @@ static struct unix_cache *find_cached_block(struct unix_private_data *data,
  * Reuse a particular cache entry for another block.
  */
 static void reuse_cache(io_channel channel, struct unix_private_data *data,
-		 struct unix_cache *cache, unsigned long block)
+		 struct unix_cache *cache, unsigned long long block)
 {
 	if (cache->dirty && cache->in_use)
 		raw_write_blk(channel, data, cache->block, 1, cache->buf);
@@ -545,7 +551,7 @@ static errcode_t unix_set_blksize(io_channel channel, int blksize)
 }
 
 
-static errcode_t unix_read_blk(io_channel channel, unsigned long block,
+static errcode_t unix_read_blk64(io_channel channel, unsigned long long block,
 			       int count, void *buf)
 {
 	struct unix_private_data *data;
@@ -610,7 +616,13 @@ static errcode_t unix_read_blk(io_channel channel, unsigned long block,
 #endif /* NO_IO_CACHE */
 }
 
-static errcode_t unix_write_blk(io_channel channel, unsigned long block,
+static errcode_t unix_read_blk(io_channel channel, unsigned long block,
+			       int count, void *buf)
+{
+	return unix_read_blk64(channel, block, count, buf);
+}
+
+static errcode_t unix_write_blk64(io_channel channel, unsigned long long block,
 				int count, const void *buf)
 {
 	struct unix_private_data *data;
@@ -662,6 +674,12 @@ static errcode_t unix_write_blk(io_channel channel, unsigned long block,
 #endif /* NO_IO_CACHE */
 }
 
+static errcode_t unix_write_blk(io_channel channel, unsigned long block,
+				int count, const void *buf)
+{
+	return unix_write_blk64(channel, block, count, buf);
+}
+
 static errcode_t unix_write_byte(io_channel channel, unsigned long offset,
 				 int size, const void *buf)
 {


  parent reply	other threads:[~2008-03-03 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 16:41 [RFC PATCH 0/3][e2fsprogs] 64bit IO manager support Jose R. Santos
2008-03-03 16:41 ` [RFC PATCH 1/3][e2fsprogs] Add 64-bit IO manager operations to struct_io_manager Jose R. Santos
2008-03-10 14:40   ` Theodore Tso
2008-03-03 16:41 ` Jose R. Santos [this message]
2008-03-03 16:41 ` [RFC PATCH 3/3][e2fsprogs] Add {read,write}_blk64 to inode_io.c Jose R. Santos

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=20080303164124.5557.52087.stgit@gara \
    --to=jrs@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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