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>
19 #include <linux/version.h>
21 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
22 #include <asm/statfs.h>
26 #include <linux/dcache.h>
27 #include <linux/jbd.h>
28 #include <linux/ext3_fs.h>
29 #include <linux/proc_fs.h>
31 #include <linux/obd_class.h>
32 #include <linux/lustre_net.h>
33 #include <linux/lustre_mds.h>
34 #include <linux/lustre_ha.h>
36 #include <linux/rbtree.h>
37 #include <linux/lustre_compat25.h>
38 #include <linux/pagemap.h>
40 /* careful, this is easy to screw up */
41 #define PAGE_CACHE_MAXBYTES ((__u64)(~0UL) << PAGE_CACHE_SHIFT)
45 struct lustre_intent_data {
46 __u64 it_lock_handle[2];
52 #define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
54 static inline struct lookup_intent *ll_nd2it(struct nameidata *nd)
56 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
63 struct ll_dentry_data {
66 struct obd_client_handle lld_cwd_och;
67 struct obd_client_handle lld_mnt_och;
70 #define ll_d2d(de) ((struct ll_dentry_data*) de->d_fsdata)
72 extern struct file_operations ll_pgcache_seq_fops;
74 #define LLI_F_HAVE_OST_SIZE_LOCK 0
75 #define LLI_F_HAVE_MDS_SIZE_LOCK 1
76 #define LLI_F_PREFER_EXTENDED_SIZE 2
77 struct ll_inode_info {
78 struct lov_stripe_md *lli_smd;
80 char *lli_symlink_name;
81 struct semaphore lli_open_sem;
84 unsigned long lli_flags;
87 /* this lock protects s_d_w and p_w_ll */
89 int lli_send_done_writing;
90 struct list_head lli_pending_write_llaps;
92 struct list_head lli_close_item;
93 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
94 struct inode lli_vfs_inode;
98 // FIXME: replace the name of this with LL_I to conform to kernel stuff
99 // static inline struct ll_inode_info *LL_I(struct inode *inode)
100 static inline struct ll_inode_info *ll_i2info(struct inode *inode)
102 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
103 return container_of(inode, struct ll_inode_info, lli_vfs_inode);
105 return (struct ll_inode_info *)&(inode->u.generic_ip);
111 LPROC_LL_DIRTY_HITS = 0,
112 LPROC_LL_DIRTY_MISSES,
113 LPROC_LL_WB_WRITEPAGE,
114 LPROC_LL_WB_PRESSURE,
118 LPROC_LL_WRITE_BYTES,
130 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
136 LPROC_LL_ALLOC_INODE,
138 LPROC_LL_DIRECT_READ,
139 LPROC_LL_DIRECT_WRITE,
140 LPROC_LL_FILE_OPCODES
144 #include <linux/lustre_idl.h>
145 #endif /* __KERNEL__ */
147 #include <linux/lustre_user.h>