Whamcloud - gitweb
A solid part of the MDS request processing infrastructure.
[fs/lustre-release.git] / lustre / include / linux / lustre_mds.h
1 #ifndef _LUSTRE_MDS_H
2 #define _LUSTRE_MDS_H
3
4 #include <linux/obd_support.h>
5
6
7 struct mds_run_ctxt { 
8         struct vfsmount *pwdmnt;
9         struct dentry   *pwd;
10         mm_segment_t     fs;
11 };
12
13 #define MDS_UNMOUNT 1
14 #define LUSTRE_MDS_NAME "mds"
15
16 struct mds_obd {
17         char *mds_fstype;
18         struct task_struct *mds_thread;
19         wait_queue_head_t mds_waitq;
20         wait_queue_head_t mds_done_waitq;
21         struct timer_list *mds_timer;
22         int mds_interval; 
23         int mds_flags;
24         struct list_head mds_reqs;
25         struct super_block * mds_sb;
26         struct vfsmount *mds_vfsmnt;
27         struct mds_run_ctxt  mds_ctxt;
28         spinlock_t mds_lock;
29         __u64 mds_lastino;
30         struct file_operations *mds_fop; 
31         struct inode_operations *mds_iop;
32         struct address_space_operations *mds_aops;
33 };
34
35 #define MDS_GETATTR   1
36 #define MDS_SETATTR  2
37 #define MDS_OPEN     3
38 #define MDS_CREATE   4
39 #define MDS_LINK     5
40 #define MDS_SYMLINK  6
41 #define MDS_MKNOD    7
42 #define MDS_MKDIR    8
43 #define MDS_UNLINK   9
44 #define MDS_RMDIR   10
45 #define MDS_RENAME  11
46
47 struct mds_request { 
48         struct list_head *rq_list;
49         struct mds_obd *rq_obd;
50         int rq_status;
51
52         char *rq_reqbuf;
53         int rq_reqlen;
54         struct mds_req_hdr *rq_reqhdr;
55         struct mds_req *rq_req;
56
57         char *rq_repbuf;
58         int rq_replen;
59         struct mds_rep_hdr *rq_rephdr;
60         struct mds_rep *rq_rep;
61
62         wait_queue_head_t rq_wait_for_mds_rep;
63 };
64
65
66 /* mds/mds_pack.c */
67 int mds_pack_req(char *name, int namelen, char *tgt, int tgtlen, struct mds_req_hdr **hdr, struct mds_req **req, int *len, char **buf);
68 int mds_unpack_req(char *buf, int len, struct mds_req_hdr **hdr, struct mds_req **req);
69 int mds_pack_rep(char *name, int namelen, char *tgt, int tgtlen, struct mds_rep_hdr **hdr, struct mds_rep **rep, int *len, char **buf);
70 int mds_unpack_rep(char *buf, int len, struct mds_rep_hdr **hdr, struct mds_rep **rep);
71
72
73 #endif
74
75