Whamcloud - gitweb
No new functionality outside of the DLM. ptlrpc_client no longer contains
[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/obdo.h>
20
21 #define LUSTRE_LITE_NAME "llite"
22
23 extern kmem_cache_t *ll_file_data_slab;
24 struct ll_file_data { 
25         __u64 fd_mdshandle; 
26 };
27
28 #define LL_INLINESZ      60
29 struct ll_inode_info {
30         int              lli_flags;
31         __u64            lli_objid; 
32         char             lli_inline[LL_INLINESZ];
33 };
34
35 #define LL_SUPER_MAGIC 0x0BD00BD0;
36 struct ll_sb_info {
37         struct list_head         ll_list;      /* list of supers */
38         struct obd_conn          ll_conn;
39         struct super_block      *ll_super;
40         ino_t                    ll_rootino;   /* number of root inode */
41         int                      ll_minor;     /* minor of /dev/obdX */
42         struct list_head         ll_inodes;    /* list of dirty inodes */
43         unsigned long            ll_cache_count;
44         struct semaphore         ll_list_mutex;
45         struct ptlrpc_client     ll_mds_client;
46         struct lustre_peer       ll_mds_peer;
47         struct ptlrpc_client     ll_ost_client;
48         struct lustre_peer       ll_ost_peer;
49 };
50
51
52 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
53 {
54         return (struct ll_sb_info *) (inode->i_sb->u.generic_sbp);
55 }
56
57 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
58 {
59         return (struct ll_inode_info *)&(inode->u.generic_ip);
60 }
61
62 static inline int ll_has_inline(struct inode *inode)
63 {
64         return (ll_i2info(inode)->lli_flags & OBD_FL_INLINEDATA);
65 }
66
67
68 static inline struct obd_conn *ll_i2obdconn(struct inode *inode)
69 {
70         return &(ll_i2sbi(inode))->ll_conn;
71 }
72
73 /* dir.c */
74 extern struct file_operations ll_dir_operations;
75 extern struct inode_operations ll_dir_inode_operations;
76
77 /* file.c */
78 extern struct file_operations ll_file_operations;
79 extern struct inode_operations ll_file_inode_operations;
80
81 /* rw.c */
82 struct page *ll_getpage(struct inode *inode, unsigned long offset,
83                            int create, int locked);
84 void ll_truncate(struct inode *inode);
85
86 /* symlink.c */
87 extern struct inode_operations ll_fast_symlink_inode_operations;
88 extern struct inode_operations ll_symlink_inode_operations;
89
90 /* sysctl.c */
91 void ll_sysctl_init(void);
92 void ll_sysctl_clean(void);
93
94
95
96 static inline struct list_head *ll_slist(struct inode *inode) 
97 {
98         struct ll_sb_info *sbi = ll_i2sbi(inode);
99
100         return &sbi->ll_inodes;
101 }
102
103 #endif
104