1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * lustre lite cluster file system
6 * This code is issued under the GNU General Public License.
7 * See the file COPYING in this distribution
9 * Copyright (C) 2002 Cluster File Systems, Inc. <info@clusterfs.com>
18 #include <linux/ext2_fs.h>
20 #include <linux/obd_class.h>
21 #include <linux/lustre_net.h>
22 #include <linux/lustre_mds.h>
23 #include <linux/lustre_ha.h>
25 extern kmem_cache_t *ll_file_data_slab;
28 struct ptlrpc_request *fd_req;
34 struct mds_body *body;
35 struct lov_mds_md *md;
38 #define LL_IOC_GETFLAGS _IOR ('f', 151, long)
39 #define LL_IOC_SETFLAGS _IOW ('f', 152, long)
40 #define LL_IOC_CLRFLAGS _IOW ('f', 153, long)
42 #define LL_FILE_IGNORE_LOCK 0x00000001
44 #define LL_INLINESZ 60
45 struct ll_inode_info {
46 struct lov_stripe_md *lli_smd;
47 char *lli_symlink_name;
48 struct lustre_handle lli_intent_lock_handle;
49 struct semaphore lli_open_sem;
52 #define LL_SUPER_MAGIC 0x0BD00BD0
54 #define LL_COMMITCBD_STOPPING 0x1
55 #define LL_COMMITCBD_STOPPED 0x2
56 #define LL_COMMITCBD_RUNNING 0x4
58 #define LL_SBI_NOLCK 0x1
61 unsigned char ll_sb_uuid[37];
62 struct lustre_handle ll_mdc_conn;
63 struct lustre_handle ll_osc_conn;
64 obd_id ll_rootino; /* number of root inode */
67 wait_queue_head_t ll_commitcbd_waitq;
68 wait_queue_head_t ll_commitcbd_ctl_waitq;
69 int ll_commitcbd_flags;
70 struct task_struct *ll_commitcbd_thread;
71 time_t ll_commitcbd_waketime;
72 time_t ll_commitcbd_timeout;
73 spinlock_t ll_commitcbd_lock;
77 static inline struct ll_sb_info *ll_s2sbi(struct super_block *sb)
79 return (struct ll_sb_info *)(sb->u.generic_sbp);
82 static inline struct lustre_handle *ll_s2obdconn(struct super_block *sb)
84 return &(ll_s2sbi(sb))->ll_osc_conn;
87 static inline struct client_obd *sbi2mdc(struct ll_sb_info *sbi)
89 struct obd_device *obd = class_conn2obd(&sbi->ll_mdc_conn);
95 static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
97 return ll_s2sbi(inode->i_sb);
100 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
102 return (struct ll_inode_info *)&(inode->u.generic_ip);
105 static inline struct lustre_handle *ll_i2obdconn(struct inode *inode)
107 return ll_s2obdconn(inode->i_sb);
110 static inline void ll_ino2fid(struct ll_fid *fid, obd_id ino, __u32 generation,
114 fid->generation = generation;
118 static inline void ll_inode2fid(struct ll_fid *fid, struct inode *inode)
120 ll_ino2fid(fid, inode->i_ino, inode->i_generation,
121 inode->i_mode & S_IFMT);
125 int ll_lock(struct inode *dir, struct dentry *dentry,
126 struct lookup_intent *it, struct lustre_handle *lockh);
127 int ll_unlock(__u32 mode, struct lustre_handle *lockh);
130 void ll_intent_release(struct dentry *de);
133 extern struct file_operations ll_dir_operations;
134 extern struct inode_operations ll_dir_inode_operations;
137 extern struct file_operations ll_file_operations;
138 extern struct inode_operations ll_file_inode_operations;
140 int ll_lock_callback(struct ldlm_lock *, struct ldlm_lock_desc *, void *data,
142 int ll_size_lock(struct inode *, struct lov_stripe_md *, __u64 start, int mode,
143 struct lustre_handle **);
144 int ll_size_unlock(struct inode *, struct lov_stripe_md *, int mode,
145 struct lustre_handle *);
146 int ll_file_size(struct inode *inode, struct lov_stripe_md *md);
149 struct page *ll_getpage(struct inode *inode, unsigned long offset,
150 int create, int locked);
151 void ll_truncate(struct inode *inode);
154 extern struct inode_operations ll_fast_symlink_inode_operations;
155 extern struct inode_operations ll_symlink_inode_operations;
158 void ll_sysctl_init(void);
159 void ll_sysctl_clean(void);