diff options
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r-- | fs/ceph/mds_client.h | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index c98267ce6d2a..7d8a0d662d56 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
@@ -8,9 +8,9 @@ | |||
8 | #include <linux/rbtree.h> | 8 | #include <linux/rbtree.h> |
9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
10 | 10 | ||
11 | #include "types.h" | 11 | #include <linux/ceph/types.h> |
12 | #include "messenger.h" | 12 | #include <linux/ceph/messenger.h> |
13 | #include "mdsmap.h" | 13 | #include <linux/ceph/mdsmap.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Some lock dependencies: | 16 | * Some lock dependencies: |
@@ -26,7 +26,7 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | struct ceph_client; | 29 | struct ceph_fs_client; |
30 | struct ceph_cap; | 30 | struct ceph_cap; |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -35,6 +35,7 @@ struct ceph_cap; | |||
35 | */ | 35 | */ |
36 | struct ceph_mds_reply_info_in { | 36 | struct ceph_mds_reply_info_in { |
37 | struct ceph_mds_reply_inode *in; | 37 | struct ceph_mds_reply_inode *in; |
38 | struct ceph_dir_layout dir_layout; | ||
38 | u32 symlink_len; | 39 | u32 symlink_len; |
39 | char *symlink; | 40 | char *symlink; |
40 | u32 xattr_len; | 41 | u32 xattr_len; |
@@ -42,26 +43,37 @@ struct ceph_mds_reply_info_in { | |||
42 | }; | 43 | }; |
43 | 44 | ||
44 | /* | 45 | /* |
45 | * parsed info about an mds reply, including information about the | 46 | * parsed info about an mds reply, including information about |
46 | * target inode and/or its parent directory and dentry, and directory | 47 | * either: 1) the target inode and/or its parent directory and dentry, |
47 | * contents (for readdir results). | 48 | * and directory contents (for readdir results), or |
49 | * 2) the file range lock info (for fcntl F_GETLK results). | ||
48 | */ | 50 | */ |
49 | struct ceph_mds_reply_info_parsed { | 51 | struct ceph_mds_reply_info_parsed { |
50 | struct ceph_mds_reply_head *head; | 52 | struct ceph_mds_reply_head *head; |
51 | 53 | ||
54 | /* trace */ | ||
52 | struct ceph_mds_reply_info_in diri, targeti; | 55 | struct ceph_mds_reply_info_in diri, targeti; |
53 | struct ceph_mds_reply_dirfrag *dirfrag; | 56 | struct ceph_mds_reply_dirfrag *dirfrag; |
54 | char *dname; | 57 | char *dname; |
55 | u32 dname_len; | 58 | u32 dname_len; |
56 | struct ceph_mds_reply_lease *dlease; | 59 | struct ceph_mds_reply_lease *dlease; |
57 | 60 | ||
58 | struct ceph_mds_reply_dirfrag *dir_dir; | 61 | /* extra */ |
59 | int dir_nr; | 62 | union { |
60 | char **dir_dname; | 63 | /* for fcntl F_GETLK results */ |
61 | u32 *dir_dname_len; | 64 | struct ceph_filelock *filelock_reply; |
62 | struct ceph_mds_reply_lease **dir_dlease; | 65 | |
63 | struct ceph_mds_reply_info_in *dir_in; | 66 | /* for readdir results */ |
64 | u8 dir_complete, dir_end; | 67 | struct { |
68 | struct ceph_mds_reply_dirfrag *dir_dir; | ||
69 | int dir_nr; | ||
70 | char **dir_dname; | ||
71 | u32 *dir_dname_len; | ||
72 | struct ceph_mds_reply_lease **dir_dlease; | ||
73 | struct ceph_mds_reply_info_in *dir_in; | ||
74 | u8 dir_complete, dir_end; | ||
75 | }; | ||
76 | }; | ||
65 | 77 | ||
66 | /* encoded blob describing snapshot contexts for certain | 78 | /* encoded blob describing snapshot contexts for certain |
67 | operations (e.g., open) */ | 79 | operations (e.g., open) */ |
@@ -154,7 +166,6 @@ struct ceph_mds_request { | |||
154 | struct ceph_mds_client *r_mdsc; | 166 | struct ceph_mds_client *r_mdsc; |
155 | 167 | ||
156 | int r_op; /* mds op code */ | 168 | int r_op; /* mds op code */ |
157 | int r_mds; | ||
158 | 169 | ||
159 | /* operation on what? */ | 170 | /* operation on what? */ |
160 | struct inode *r_inode; /* arg1 */ | 171 | struct inode *r_inode; /* arg1 */ |
@@ -170,6 +181,8 @@ struct ceph_mds_request { | |||
170 | 181 | ||
171 | union ceph_mds_request_args r_args; | 182 | union ceph_mds_request_args r_args; |
172 | int r_fmode; /* file mode, if expecting cap */ | 183 | int r_fmode; /* file mode, if expecting cap */ |
184 | uid_t r_uid; | ||
185 | gid_t r_gid; | ||
173 | 186 | ||
174 | /* for choosing which mds to send this request to */ | 187 | /* for choosing which mds to send this request to */ |
175 | int r_direct_mode; | 188 | int r_direct_mode; |
@@ -230,7 +243,7 @@ struct ceph_mds_request { | |||
230 | * mds client state | 243 | * mds client state |
231 | */ | 244 | */ |
232 | struct ceph_mds_client { | 245 | struct ceph_mds_client { |
233 | struct ceph_client *client; | 246 | struct ceph_fs_client *fsc; |
234 | struct mutex mutex; /* all nested structures */ | 247 | struct mutex mutex; /* all nested structures */ |
235 | 248 | ||
236 | struct ceph_mdsmap *mdsmap; | 249 | struct ceph_mdsmap *mdsmap; |
@@ -265,6 +278,7 @@ struct ceph_mds_client { | |||
265 | 278 | ||
266 | u64 cap_flush_seq; | 279 | u64 cap_flush_seq; |
267 | struct list_head cap_dirty; /* inodes with dirty caps */ | 280 | struct list_head cap_dirty; /* inodes with dirty caps */ |
281 | struct list_head cap_dirty_migrating; /* ...that are migration... */ | ||
268 | int num_cap_flushing; /* # caps we are flushing */ | 282 | int num_cap_flushing; /* # caps we are flushing */ |
269 | spinlock_t cap_dirty_lock; /* protects above items */ | 283 | spinlock_t cap_dirty_lock; /* protects above items */ |
270 | wait_queue_head_t cap_flushing_wq; | 284 | wait_queue_head_t cap_flushing_wq; |
@@ -289,11 +303,6 @@ struct ceph_mds_client { | |||
289 | int caps_avail_count; /* unused, unreserved */ | 303 | int caps_avail_count; /* unused, unreserved */ |
290 | int caps_min_count; /* keep at least this many | 304 | int caps_min_count; /* keep at least this many |
291 | (unreserved) */ | 305 | (unreserved) */ |
292 | |||
293 | #ifdef CONFIG_DEBUG_FS | ||
294 | struct dentry *debugfs_file; | ||
295 | #endif | ||
296 | |||
297 | spinlock_t dentry_lru_lock; | 306 | spinlock_t dentry_lru_lock; |
298 | struct list_head dentry_lru; | 307 | struct list_head dentry_lru; |
299 | int num_dentry; | 308 | int num_dentry; |
@@ -316,10 +325,9 @@ extern void ceph_put_mds_session(struct ceph_mds_session *s); | |||
316 | extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc, | 325 | extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc, |
317 | struct ceph_msg *msg, int mds); | 326 | struct ceph_msg *msg, int mds); |
318 | 327 | ||
319 | extern int ceph_mdsc_init(struct ceph_mds_client *mdsc, | 328 | extern int ceph_mdsc_init(struct ceph_fs_client *fsc); |
320 | struct ceph_client *client); | ||
321 | extern void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc); | 329 | extern void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc); |
322 | extern void ceph_mdsc_stop(struct ceph_mds_client *mdsc); | 330 | extern void ceph_mdsc_destroy(struct ceph_fs_client *fsc); |
323 | 331 | ||
324 | extern void ceph_mdsc_sync(struct ceph_mds_client *mdsc); | 332 | extern void ceph_mdsc_sync(struct ceph_mds_client *mdsc); |
325 | 333 | ||