Whamcloud - gitweb
- rename ha_mgr to recovd
[fs/lustre-release.git] / lustre / include / linux / lustre_lite.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * lustre lite cluster file system
5  * 
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  * 
9  *
10  *
11
12
13
14 #ifndef _LL_H
15 #define _LL_H
16
17 #include <linux/fs.h>
18 #include <linux/ext2_fs.h>
19
20 #include <linux/lustre_net.h>
21 #include <linux/lustre_mds.h>
22 #include <linux/lustre_ha.h>
23 #include <linux/obdo.h>
24
25 extern kmem_cache_t *ll_file_data_slab;
26 struct ll_file_data { 
27         __u64 fd_mdshandle; 
28 };
29
30 #define LL_INLINESZ      60
31 struct ll_inode_info {
32         int              lli_flags;
33         __u64            lli_objid; 
34         char             lli_inline[LL_INLINESZ];
35 };
36
37 #define LL_SUPER_MAGIC 0x0BD00BD0;
38
39 #define LL_COMMITCBD_STOPPING  0x1
40 #define LL_COMMITCBD_STOPPED   0x2
41 #define LL_COMMITCBD_RUNNING   0x4
42
43 struct ll_sb_info {
44         struct obd_conn           ll_conn;
45         ino_t                     ll_rootino; /* number of root inode */
46         struct ptlrpc_client      ll_mds_client;
47         struct ptlrpc_connection *ll_mds_conn;
48         struct ptlrpc_client      ll_ost_client;
49         struct ptlrpc_connection *ll_ost_conn;
50
51         struct list_head          ll_commitcbd_not_committed;
52         wait_queue_head_t         ll_commitcbd_waitq;
53         wait_queue_head_t         ll_commitcbd_ctl_waitq;
54         int                       ll_commitcbd_flags;
55         struct task_struct        *ll_commitcbd_thread;
56         time_t                    ll_commitcbd_waketime;
57         time_t                    ll_commitcbd_timeout;
58         spinlock_t                ll_commitcbd_lock;
59 };
60
61
62 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
63 {
64         return (struct ll_sb_info *) (inode->i_sb->u.generic_sbp);
65 }
66
67 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
68 {
69         return (struct ll_inode_info *)&(inode->u.generic_ip);
70 }
71
72 static inline int ll_has_inline(struct inode *inode)
73 {
74         return (ll_i2info(inode)->lli_flags & OBD_FL_INLINEDATA);
75 }
76
77
78 static inline struct obd_conn *ll_i2obdconn(struct inode *inode)
79 {
80         return &(ll_i2sbi(inode))->ll_conn;
81 }
82
83 static inline void ll_ino2fid(struct ll_fid *fid, ino_t ino, __u32 generation,
84                               int type)
85 {
86         fid->id = (__u64)ino;
87         fid->generation = generation;
88         fid->f_type = type;
89 }
90
91 static inline void ll_inode2fid(struct ll_fid *fid, struct inode *inode)
92 {
93         ll_ino2fid(fid, inode->i_ino, inode->i_generation,
94                    inode->i_mode & S_IFMT);
95 }
96
97 /* dir.c */
98 extern struct file_operations ll_dir_operations;
99 extern struct inode_operations ll_dir_inode_operations;
100
101 /* file.c */
102 extern struct file_operations ll_file_operations;
103 extern struct inode_operations ll_file_inode_operations;
104
105 /* rw.c */
106 struct page *ll_getpage(struct inode *inode, unsigned long offset,
107                            int create, int locked);
108 void ll_truncate(struct inode *inode);
109
110 /* symlink.c */
111 extern struct inode_operations ll_fast_symlink_inode_operations;
112 extern struct inode_operations ll_symlink_inode_operations;
113
114 /* sysctl.c */
115 void ll_sysctl_init(void);
116 void ll_sysctl_clean(void);
117
118 #endif