aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exofs/exofs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exofs/exofs.h')
-rw-r--r--fs/exofs/exofs.h57
1 files changed, 47 insertions, 10 deletions
diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h
index c35fd4623986..54373278a353 100644
--- a/fs/exofs/exofs.h
+++ b/fs/exofs/exofs.h
@@ -35,6 +35,7 @@
35 35
36#include <linux/fs.h> 36#include <linux/fs.h>
37#include <linux/time.h> 37#include <linux/time.h>
38#include <linux/backing-dev.h>
38#include "common.h" 39#include "common.h"
39 40
40/* FIXME: Remove once pnfs hits mainline 41/* FIXME: Remove once pnfs hits mainline
@@ -55,12 +56,28 @@
55/* u64 has problems with printk this will cast it to unsigned long long */ 56/* u64 has problems with printk this will cast it to unsigned long long */
56#define _LLU(x) (unsigned long long)(x) 57#define _LLU(x) (unsigned long long)(x)
57 58
59struct exofs_layout {
60 osd_id s_pid; /* partition ID of file system*/
61
62 /* Our way of looking at the data_map */
63 unsigned stripe_unit;
64 unsigned mirrors_p1;
65
66 unsigned group_width;
67 u64 group_depth;
68 unsigned group_count;
69
70 enum exofs_inode_layout_gen_functions lay_func;
71
72 unsigned s_numdevs; /* Num of devices in array */
73 struct osd_dev *s_ods[0]; /* Variable length */
74};
75
58/* 76/*
59 * our extension to the in-memory superblock 77 * our extension to the in-memory superblock
60 */ 78 */
61struct exofs_sb_info { 79struct exofs_sb_info {
62 struct exofs_fscb s_fscb; /* Written often, pre-allocate*/ 80 struct exofs_fscb s_fscb; /* Written often, pre-allocate*/
63 osd_id s_pid; /* partition ID of file system*/
64 int s_timeout; /* timeout for OSD operations */ 81 int s_timeout; /* timeout for OSD operations */
65 uint64_t s_nextid; /* highest object ID used */ 82 uint64_t s_nextid; /* highest object ID used */
66 uint32_t s_numfiles; /* number of files on fs */ 83 uint32_t s_numfiles; /* number of files on fs */
@@ -69,22 +86,28 @@ struct exofs_sb_info {
69 atomic_t s_curr_pending; /* number of pending commands */ 86 atomic_t s_curr_pending; /* number of pending commands */
70 uint8_t s_cred[OSD_CAP_LEN]; /* credential for the fscb */ 87 uint8_t s_cred[OSD_CAP_LEN]; /* credential for the fscb */
71 88
72 struct pnfs_osd_data_map data_map; /* Default raid to use */ 89 struct pnfs_osd_data_map data_map; /* Default raid to use
73 unsigned s_numdevs; /* Num of devices in array */ 90 * FIXME: Needed ?
74 struct osd_dev *s_ods[1]; /* Variable length, minimum 1 */ 91 */
92/* struct exofs_layout dir_layout;*/ /* Default dir layout */
93 struct exofs_layout layout; /* Default files layout,
94 * contains the variable osd_dev
95 * array. Keep last */
96 struct backing_dev_info bdi;
97 struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
75}; 98};
76 99
77/* 100/*
78 * our extension to the in-memory inode 101 * our extension to the in-memory inode
79 */ 102 */
80struct exofs_i_info { 103struct exofs_i_info {
104 struct inode vfs_inode; /* normal in-memory inode */
105 wait_queue_head_t i_wq; /* wait queue for inode */
81 unsigned long i_flags; /* various atomic flags */ 106 unsigned long i_flags; /* various atomic flags */
82 uint32_t i_data[EXOFS_IDATA];/*short symlink names and device #s*/ 107 uint32_t i_data[EXOFS_IDATA];/*short symlink names and device #s*/
83 uint32_t i_dir_start_lookup; /* which page to start lookup */ 108 uint32_t i_dir_start_lookup; /* which page to start lookup */
84 wait_queue_head_t i_wq; /* wait queue for inode */
85 uint64_t i_commit_size; /* the object's written length */ 109 uint64_t i_commit_size; /* the object's written length */
86 uint8_t i_cred[OSD_CAP_LEN];/* all-powerful credential */ 110 uint8_t i_cred[OSD_CAP_LEN];/* all-powerful credential */
87 struct inode vfs_inode; /* normal in-memory inode */
88}; 111};
89 112
90static inline osd_id exofs_oi_objno(struct exofs_i_info *oi) 113static inline osd_id exofs_oi_objno(struct exofs_i_info *oi)
@@ -101,7 +124,7 @@ struct exofs_io_state {
101 void *private; 124 void *private;
102 exofs_io_done_fn done; 125 exofs_io_done_fn done;
103 126
104 struct exofs_sb_info *sbi; 127 struct exofs_layout *layout;
105 struct osd_obj_id obj; 128 struct osd_obj_id obj;
106 u8 *cred; 129 u8 *cred;
107 130
@@ -109,7 +132,11 @@ struct exofs_io_state {
109 loff_t offset; 132 loff_t offset;
110 unsigned long length; 133 unsigned long length;
111 void *kern_buff; 134 void *kern_buff;
112 struct bio *bio; 135
136 struct page **pages;
137 unsigned nr_pages;
138 unsigned pgbase;
139 unsigned pages_consumed;
113 140
114 /* Attributes */ 141 /* Attributes */
115 unsigned in_attr_len; 142 unsigned in_attr_len;
@@ -122,6 +149,9 @@ struct exofs_io_state {
122 struct exofs_per_dev_state { 149 struct exofs_per_dev_state {
123 struct osd_request *or; 150 struct osd_request *or;
124 struct bio *bio; 151 struct bio *bio;
152 loff_t offset;
153 unsigned length;
154 unsigned dev;
125 } per_dev[]; 155 } per_dev[];
126}; 156};
127 157
@@ -175,6 +205,12 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode)
175} 205}
176 206
177/* 207/*
208 * Given a layout, object_number and stripe_index return the associated global
209 * dev_index
210 */
211unsigned exofs_layout_od_id(struct exofs_layout *layout,
212 osd_id obj_no, unsigned layout_index);
213/*
178 * Maximum count of links to a file 214 * Maximum count of links to a file
179 */ 215 */
180#define EXOFS_LINK_MAX 32000 216#define EXOFS_LINK_MAX 32000
@@ -189,7 +225,8 @@ void exofs_make_credential(u8 cred_a[OSD_CAP_LEN],
189int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj, 225int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj,
190 u64 offset, void *p, unsigned length); 226 u64 offset, void *p, unsigned length);
191 227
192int exofs_get_io_state(struct exofs_sb_info *sbi, struct exofs_io_state** ios); 228int exofs_get_io_state(struct exofs_layout *layout,
229 struct exofs_io_state **ios);
193void exofs_put_io_state(struct exofs_io_state *ios); 230void exofs_put_io_state(struct exofs_io_state *ios);
194 231
195int exofs_check_io(struct exofs_io_state *ios, u64 *resid); 232int exofs_check_io(struct exofs_io_state *ios, u64 *resid);
@@ -226,7 +263,7 @@ int exofs_write_begin(struct file *file, struct address_space *mapping,
226 struct page **pagep, void **fsdata); 263 struct page **pagep, void **fsdata);
227extern struct inode *exofs_iget(struct super_block *, unsigned long); 264extern struct inode *exofs_iget(struct super_block *, unsigned long);
228struct inode *exofs_new_inode(struct inode *, int); 265struct inode *exofs_new_inode(struct inode *, int);
229extern int exofs_write_inode(struct inode *, int); 266extern int exofs_write_inode(struct inode *, struct writeback_control *wbc);
230extern void exofs_delete_inode(struct inode *); 267extern void exofs_delete_inode(struct inode *);
231 268
232/* dir.c: */ 269/* dir.c: */