diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2011-05-22 12:52:19 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2011-05-29 13:54:15 -0400 |
commit | 04f83450388e87d86b387cf4a27b81eb7e69de7d (patch) | |
tree | 99c10d6a995ed1e7b872abb0127fc38d6bef9982 /fs/nfs/objlayout/objlayout.h | |
parent | d20581aa4be11407c9eeeb75992df5ef176bba0f (diff) |
pnfs-obj: osd raid engine read/write implementation
With the use of the in-kernel osd library. Implement read/write
of data from/to osd-objects according to information specified
in the objects-layout.
Support for stripping over mirrors with a received stripe_unit.
There are however a few constrains which are not supported:
1. Stripe Unit must be a multiple of PAGE_SIZE
2. stripe length (stripe_unit * number_of_stripes) can not be
bigger then 32bit.
Also support raid-groups and partial-layout. Partial-layout is
when not all the groups are received on the line, addressing
only a partial range of the file.
TODO:
Only raid0! raid 4/5/6 support will come at later stage
A none supported layout will send IO through the MDS
[Important fallout from the last rebase]
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
[gfp_flags]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs/objlayout/objlayout.h')
-rw-r--r-- | fs/nfs/objlayout/objlayout.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/fs/nfs/objlayout/objlayout.h b/fs/nfs/objlayout/objlayout.h index fa0262149f59..9a405e8069f3 100644 --- a/fs/nfs/objlayout/objlayout.h +++ b/fs/nfs/objlayout/objlayout.h | |||
@@ -59,6 +59,26 @@ OBJLAYOUT(struct pnfs_layout_hdr *lo) | |||
59 | } | 59 | } |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * per-I/O operation state | ||
63 | * embedded in objects provider io_state data structure | ||
64 | */ | ||
65 | struct objlayout_io_state { | ||
66 | struct pnfs_layout_segment *lseg; | ||
67 | |||
68 | struct page **pages; | ||
69 | unsigned pgbase; | ||
70 | unsigned nr_pages; | ||
71 | unsigned long count; | ||
72 | loff_t offset; | ||
73 | bool sync; | ||
74 | |||
75 | void *rpcdata; | ||
76 | int status; /* res */ | ||
77 | int eof; /* res */ | ||
78 | int committed; /* res */ | ||
79 | }; | ||
80 | |||
81 | /* | ||
62 | * Raid engine I/O API | 82 | * Raid engine I/O API |
63 | */ | 83 | */ |
64 | extern int objio_alloc_lseg(struct pnfs_layout_segment **outp, | 84 | extern int objio_alloc_lseg(struct pnfs_layout_segment **outp, |
@@ -68,9 +88,24 @@ extern int objio_alloc_lseg(struct pnfs_layout_segment **outp, | |||
68 | gfp_t gfp_flags); | 88 | gfp_t gfp_flags); |
69 | extern void objio_free_lseg(struct pnfs_layout_segment *lseg); | 89 | extern void objio_free_lseg(struct pnfs_layout_segment *lseg); |
70 | 90 | ||
91 | extern int objio_alloc_io_state( | ||
92 | struct pnfs_layout_segment *lseg, | ||
93 | struct objlayout_io_state **outp, | ||
94 | gfp_t gfp_flags); | ||
95 | extern void objio_free_io_state(struct objlayout_io_state *state); | ||
96 | |||
97 | extern ssize_t objio_read_pagelist(struct objlayout_io_state *ol_state); | ||
98 | extern ssize_t objio_write_pagelist(struct objlayout_io_state *ol_state, | ||
99 | bool stable); | ||
100 | |||
71 | /* | 101 | /* |
72 | * callback API | 102 | * callback API |
73 | */ | 103 | */ |
104 | extern void objlayout_read_done(struct objlayout_io_state *state, | ||
105 | ssize_t status, bool sync); | ||
106 | extern void objlayout_write_done(struct objlayout_io_state *state, | ||
107 | ssize_t status, bool sync); | ||
108 | |||
74 | extern int objlayout_get_deviceinfo(struct pnfs_layout_hdr *pnfslay, | 109 | extern int objlayout_get_deviceinfo(struct pnfs_layout_hdr *pnfslay, |
75 | struct nfs4_deviceid *d_id, struct pnfs_osd_deviceaddr **deviceaddr, | 110 | struct nfs4_deviceid *d_id, struct pnfs_osd_deviceaddr **deviceaddr, |
76 | gfp_t gfp_flags); | 111 | gfp_t gfp_flags); |
@@ -89,4 +124,11 @@ extern struct pnfs_layout_segment *objlayout_alloc_lseg( | |||
89 | gfp_t gfp_flags); | 124 | gfp_t gfp_flags); |
90 | extern void objlayout_free_lseg(struct pnfs_layout_segment *); | 125 | extern void objlayout_free_lseg(struct pnfs_layout_segment *); |
91 | 126 | ||
127 | extern enum pnfs_try_status objlayout_read_pagelist( | ||
128 | struct nfs_read_data *); | ||
129 | |||
130 | extern enum pnfs_try_status objlayout_write_pagelist( | ||
131 | struct nfs_write_data *, | ||
132 | int how); | ||
133 | |||
92 | #endif /* _OBJLAYOUT_H */ | 134 | #endif /* _OBJLAYOUT_H */ |