summaryrefslogtreecommitdiffstats
path: root/fs/exofs/ios.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2010-11-16 19:09:58 +0100
committerBoaz Harrosh <bharrosh@panasas.com>2011-08-07 04:35:31 +0200
commite1042ba0991aab80ced34f7dade6ec25f22b4304 (patch)
tree5953383f9235df91acfc2315a5c6fbdfb359ecf1 /fs/exofs/ios.c
parentexofs: Fix truncate for the raid-groups case (diff)
downloadlinux-e1042ba0991aab80ced34f7dade6ec25f22b4304.tar.xz
linux-e1042ba0991aab80ced34f7dade6ec25f22b4304.zip
exofs: Add offset/length to exofs_get_io_state
In future raid code we will need to know the IO offset/length and if it's a read or write to determine some of the array sizes we'll need. So add a new exofs_get_rw_state() API for use when writeing/reading. All other simple cases are left using the old way. The major change to this is that now we need to call exofs_get_io_state later at inode.c::read_exec and inode.c::write_exec when we actually know these things. So this patch is kept separate so I can test things apart from other changes. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to '')
-rw-r--r--fs/exofs/ios.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/exofs/ios.c b/fs/exofs/ios.c
index fbb47ba2cd71..096405e51b94 100644
--- a/fs/exofs/ios.c
+++ b/fs/exofs/ios.c
@@ -69,8 +69,8 @@ out:
return ret;
}
-int exofs_get_io_state(struct exofs_layout *layout,
- struct exofs_io_state **pios)
+int exofs_get_rw_state(struct exofs_layout *layout, bool is_reading,
+ u64 offset, u64 length, struct exofs_io_state **pios)
{
struct exofs_io_state *ios;
@@ -87,10 +87,20 @@ int exofs_get_io_state(struct exofs_layout *layout,
ios->layout = layout;
ios->obj.partition = layout->s_pid;
+ ios->offset = offset;
+ ios->length = length;
+ ios->reading = is_reading;
+
*pios = ios;
return 0;
}
+int exofs_get_io_state(struct exofs_layout *layout,
+ struct exofs_io_state **ios)
+{
+ return exofs_get_rw_state(layout, true, 0, 0, ios);
+}
+
void exofs_put_io_state(struct exofs_io_state *ios)
{
if (ios) {