From e1042ba0991aab80ced34f7dade6ec25f22b4304 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Tue, 16 Nov 2010 20:09:58 +0200 Subject: 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 --- fs/exofs/exofs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fs/exofs/exofs.h') diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h index 9f62349a5a5..fd913ddfd48 100644 --- a/fs/exofs/exofs.h +++ b/fs/exofs/exofs.h @@ -109,7 +109,7 @@ static inline osd_id exofs_oi_objno(struct exofs_i_info *oi) } struct exofs_io_state; -typedef void (*exofs_io_done_fn)(struct exofs_io_state *or, void *private); +typedef void (*exofs_io_done_fn)(struct exofs_io_state *ios, void *private); struct exofs_io_state { struct kref kref; @@ -137,6 +137,8 @@ struct exofs_io_state { unsigned out_attr_len; struct osd_attr *out_attr; + bool reading; + /* Variable array of size numdevs */ unsigned numdevs; struct exofs_per_dev_state { @@ -218,6 +220,8 @@ void exofs_make_credential(u8 cred_a[OSD_CAP_LEN], int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj, u64 offset, void *p, unsigned length); +int exofs_get_rw_state(struct exofs_layout *layout, bool is_reading, + u64 offset, u64 length, struct exofs_io_state **ios); int exofs_get_io_state(struct exofs_layout *layout, struct exofs_io_state **ios); void exofs_put_io_state(struct exofs_io_state *ios); -- cgit v1.2.3-18-g5258