aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/objlayout/objlayout.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/objlayout/objlayout.h')
-rw-r--r--fs/nfs/objlayout/objlayout.h42
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 */
65struct 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 */
64extern int objio_alloc_lseg(struct pnfs_layout_segment **outp, 84extern 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);
69extern void objio_free_lseg(struct pnfs_layout_segment *lseg); 89extern void objio_free_lseg(struct pnfs_layout_segment *lseg);
70 90
91extern int objio_alloc_io_state(
92 struct pnfs_layout_segment *lseg,
93 struct objlayout_io_state **outp,
94 gfp_t gfp_flags);
95extern void objio_free_io_state(struct objlayout_io_state *state);
96
97extern ssize_t objio_read_pagelist(struct objlayout_io_state *ol_state);
98extern 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 */
104extern void objlayout_read_done(struct objlayout_io_state *state,
105 ssize_t status, bool sync);
106extern void objlayout_write_done(struct objlayout_io_state *state,
107 ssize_t status, bool sync);
108
74extern int objlayout_get_deviceinfo(struct pnfs_layout_hdr *pnfslay, 109extern 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);
90extern void objlayout_free_lseg(struct pnfs_layout_segment *); 125extern void objlayout_free_lseg(struct pnfs_layout_segment *);
91 126
127extern enum pnfs_try_status objlayout_read_pagelist(
128 struct nfs_read_data *);
129
130extern enum pnfs_try_status objlayout_write_pagelist(
131 struct nfs_write_data *,
132 int how);
133
92#endif /* _OBJLAYOUT_H */ 134#endif /* _OBJLAYOUT_H */