4 #include <libcfs/kp30.h>
6 #define LL_ID_NAMELEN (16 + 1 + 8 + 1)
9 #include <linux/lustre_compat25.h>
10 #include <linux/lvfs_linux.h>
14 #include <lvfs_user_fs.h>
17 struct mds_grp_hash_entry;
21 struct mds_grp_hash_entry *luc_ghash;
22 struct group_info *luc_ginfo;
30 struct lvfs_callback_ops {
31 struct dentry *(*l_id2dentry)(__u64 ino, __u32 gen,
32 __u64 gr, void *data);
35 #define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA
36 #define OBD_CTXT_DEBUG /* development-only debugging */
37 struct lvfs_run_ctxt {
38 struct vfsmount *pwdmnt;
41 struct lvfs_ucred luc;
42 struct lvfs_callback_ops cb_ops;
44 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
45 struct group_info *group_info;
47 struct group_info group_info;
56 #define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC
58 #define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0)
62 struct dentry *lvfs_id2dentry(struct lvfs_run_ctxt *, __u64,
63 __u32, __u64 ,void *data);
65 void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
66 struct lvfs_ucred *cred);
67 void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
68 struct lvfs_ucred *cred);
71 int lvfs_reint(struct super_block *sb, void *r_rec);
72 int lvfs_undo(struct super_block *sb, void *r_rec);
73 struct dentry *simple_mkdir(struct dentry *dir, char *name, int mode, int fix);
74 struct dentry *simple_mknod(struct dentry *dir, char *name, int mode, int fix);
75 int lustre_fread(struct file *file, void *buf, int len, loff_t *off);
76 int lustre_fwrite(struct file *file, const void *buf, int len, loff_t *off);
77 int lustre_fsync(struct file *file);
78 long l_readdir(struct file * file, struct list_head *dentry_list);
80 static inline void l_dput(struct dentry *de)
82 if (!de || IS_ERR(de))
84 //shrink_dcache_parent(de);
85 LASSERT(atomic_read(&de->d_count) > 0);
90 void *lock_dir(struct inode *dir, struct qstr *name);
91 void unlock_dir(struct inode *dir, void *lock);
94 /* We need to hold the inode semaphore over the dcache lookup itself, or we run
95 * the risk of entering the filesystem lookup path concurrently on SMP systems,
96 * and instantiating two inodes for the same entry. We still protect against
97 * concurrent addition/removal races with the DLM locking. */
98 static inline struct dentry *
99 ll_lookup_one_len(const char *name, struct dentry *dparent, int namelen)
101 struct dentry *dchild;
107 lock = lock_dir(dparent->d_inode, &qstr);
109 down(&dparent->d_inode->i_sem);
112 dchild = lookup_one_len(name, dparent, namelen);
115 unlock_dir(dparent->d_inode, lock);
117 up(&dparent->d_inode->i_sem);
122 static inline void ll_sleep(int t)
124 set_current_state(TASK_INTERRUPTIBLE);
125 schedule_timeout(t * HZ);
126 set_current_state(TASK_RUNNING);
130 static inline int ll_id2str(char *str, __u64 id, __u32 generation)
132 return sprintf(str, "%llx:%08x", (unsigned long long)id,