Whamcloud - gitweb
- name switch: "light" --> "lite"
[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 ptlrpc_client     ll_ost_client;
47 };
48
49
50 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
51 {
52         return (struct ll_sb_info *) (inode->i_sb->u.generic_sbp);
53 }
54
55 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
56 {
57         return (struct ll_inode_info *)&(inode->u.generic_ip);
58 }
59
60 static inline int ll_has_inline(struct inode *inode)
61 {
62         return (ll_i2info(inode)->lli_flags & OBD_FL_INLINEDATA);
63 }
64
65
66 static inline struct obd_conn *ll_i2obdconn(struct inode *inode)
67 {
68         return &(ll_i2sbi(inode))->ll_conn;
69 }
70
71 /* dir.c */
72 extern struct file_operations ll_dir_operations;
73 extern struct inode_operations ll_dir_inode_operations;
74
75 /* file.c */
76 extern struct file_operations ll_file_operations;
77 extern struct inode_operations ll_file_inode_operations;
78
79 /* rw.c */
80 struct page *ll_getpage(struct inode *inode, unsigned long offset,
81                            int create, int locked);
82 void ll_truncate(struct inode *inode);
83
84 /* symlink.c */
85 extern struct inode_operations ll_fast_symlink_inode_operations;
86 extern struct inode_operations ll_symlink_inode_operations;
87
88 /* sysctl.c */
89 void ll_sysctl_init(void);
90 void ll_sysctl_clean(void);
91
92
93
94 static inline struct list_head *ll_slist(struct inode *inode) 
95 {
96         struct ll_sb_info *sbi = ll_i2sbi(inode);
97
98         return &sbi->ll_inodes;
99 }
100
101 #endif
102