4 #include <linux/kp30.h>
6 #define LL_FID_NAMELEN (16 + 1 + 8 + 1)
9 #include <linux/lvfs_linux.h>
13 #include <lvfs_user_fs.h>
25 struct lvfs_callback_ops {
26 struct dentry *(*l_fid2dentry)(__u64 id_ino, __u32 gen, __u64 gr, void *data);
29 #define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA
30 #define OBD_CTXT_DEBUG /* development-only debugging */
32 struct vfsmount *pwdmnt;
37 struct lvfs_callback_ops cb_ops;
44 #define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC
46 #define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0)
50 struct dentry *lvfs_fid2dentry(struct obd_run_ctxt *, __u64, __u32, __u64 ,void *data);
52 void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx,
53 struct obd_ucred *cred);
54 void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx,
55 struct obd_ucred *cred);
59 struct dentry *simple_mkdir(struct dentry *dir, char *name, int mode, int fix);
60 struct dentry *simple_mknod(struct dentry *dir, char *name, int mode, int fix);
61 int lustre_fread(struct file *file, void *buf, int len, loff_t *off);
62 int lustre_fwrite(struct file *file, const void *buf, int len, loff_t *off);
63 int lustre_fsync(struct file *file);
64 long l_readdir(struct file * file, struct list_head *dentry_list);
66 static inline void l_dput(struct dentry *de)
68 if (!de || IS_ERR(de))
70 //shrink_dcache_parent(de);
71 LASSERT(atomic_read(&de->d_count) > 0);
75 /* We need to hold the inode semaphore over the dcache lookup itself, or we
76 * run the risk of entering the filesystem lookup path concurrently on SMP
77 * systems, and instantiating two inodes for the same entry. We still
78 * protect against concurrent addition/removal races with the DLM locking.
80 static inline struct dentry *ll_lookup_one_len(const char *fid_name,
81 struct dentry *dparent,
84 struct dentry *dchild;
86 down(&dparent->d_inode->i_sem);
87 dchild = lookup_one_len(fid_name, dparent, fid_namelen);
88 up(&dparent->d_inode->i_sem);
93 static inline void ll_sleep(int t)
95 set_current_state(TASK_INTERRUPTIBLE);
96 schedule_timeout(t * HZ);
97 set_current_state(TASK_RUNNING);
101 static inline int ll_fid2str(char *str, __u64 id, __u32 generation)
103 return sprintf(str, "%llx:%08x", (unsigned long long)id, generation);