Whamcloud - gitweb
- added connection structure which encompasses some (but perhaps not enough yet)
[fs/lustre-release.git] / lustre / include / linux / lustre_lite.h
1 /* object based disk file system
2  * 
3  * This code is issued under the GNU General Public License.
4  * See the file COPYING in this distribution
5  * 
6  *
7  *
8  *
9
10
11
12 #ifndef _LL_H
13 #define _LL_H
14
15 #include <linux/ext2_fs.h>
16
17 #include <linux/lustre_net.h>
18 #include <linux/lustre_mds.h>
19 #include <linux/lustre_ha.h>
20 #include <linux/obdo.h>
21
22 #define LUSTRE_LITE_NAME "llite"
23
24 extern kmem_cache_t *ll_file_data_slab;
25 struct ll_file_data { 
26         __u64 fd_mdshandle; 
27 };
28
29 #define LL_INLINESZ      60
30 struct ll_inode_info {
31         int              lli_flags;
32         __u64            lli_objid; 
33         char             lli_inline[LL_INLINESZ];
34 };
35
36 #define LL_SUPER_MAGIC 0x0BD00BD0;
37 struct ll_sb_info {
38         struct list_head         ll_list;      /* list of supers */
39         struct obd_conn          ll_conn;
40         struct super_block      *ll_super;
41         ino_t                    ll_rootino;   /* number of root inode */
42         int                      ll_minor;     /* minor of /dev/obdX */
43         struct list_head         ll_inodes;    /* list of dirty inodes */
44         unsigned long            ll_cache_count;
45         struct semaphore         ll_list_mutex;
46         struct ptlrpc_client     ll_mds_client;
47         struct ptlrpc_connection *ll_mds_conn;
48         struct ptlrpc_client     ll_ost_client;
49         struct lustre_ha_mgr    *ll_ha_mgr;
50         struct ptlrpc_connection *ll_ost_conn;
51 };
52
53
54 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
55 {
56         return (struct ll_sb_info *) (inode->i_sb->u.generic_sbp);
57 }
58
59 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
60 {
61         return (struct ll_inode_info *)&(inode->u.generic_ip);
62 }
63
64 static inline int ll_has_inline(struct inode *inode)
65 {
66         return (ll_i2info(inode)->lli_flags & OBD_FL_INLINEDATA);
67 }
68
69
70 static inline struct obd_conn *ll_i2obdconn(struct inode *inode)
71 {
72         return &(ll_i2sbi(inode))->ll_conn;
73 }
74
75 /* dir.c */
76 extern struct file_operations ll_dir_operations;
77 extern struct inode_operations ll_dir_inode_operations;
78
79 /* file.c */
80 extern struct file_operations ll_file_operations;
81 extern struct inode_operations ll_file_inode_operations;
82
83 /* rw.c */
84 struct page *ll_getpage(struct inode *inode, unsigned long offset,
85                            int create, int locked);
86 void ll_truncate(struct inode *inode);
87
88 /* symlink.c */
89 extern struct inode_operations ll_fast_symlink_inode_operations;
90 extern struct inode_operations ll_symlink_inode_operations;
91
92 /* sysctl.c */
93 void ll_sysctl_init(void);
94 void ll_sysctl_clean(void);
95
96
97
98 static inline struct list_head *ll_slist(struct inode *inode) 
99 {
100         struct ll_sb_info *sbi = ll_i2sbi(inode);
101
102         return &sbi->ll_inodes;
103 }
104
105 #endif
106