4 #include <linux/kp30.h>
7 #include <linux/lvfs_linux.h>
11 #include <lvfs_user_fs.h>
23 struct lvfs_callback_ops {
24 struct dentry *(*l_fid2dentry)(__u64 id_ino, __u32 gen, __u64 gr, void *data);
27 #define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA
28 #define OBD_CTXT_DEBUG /* development-only debugging */
30 struct vfsmount *pwdmnt;
35 struct lvfs_callback_ops cb_ops;
42 #define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC
44 #define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0)
48 struct dentry *lvfs_fid2dentry(struct obd_run_ctxt *, __u64, __u32, __u64 ,void *data);
50 void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx,
51 struct obd_ucred *cred);
52 void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx,
53 struct obd_ucred *cred);
57 struct dentry *simple_mkdir(struct dentry *dir, char *name, int mode);
58 struct dentry *simple_mknod(struct dentry *dir, char *name, int mode);
59 int lustre_fread(struct file *file, void *buf, int len, loff_t *off);
60 int lustre_fwrite(struct file *file, const void *buf, int len, loff_t *off);
61 int lustre_fsync(struct file *file);
62 long l_readdir(struct file * file, void * dirent, unsigned int count);
64 static inline void l_dput(struct dentry *de)
66 if (!de || IS_ERR(de))
68 //shrink_dcache_parent(de);
69 LASSERT(atomic_read(&de->d_count) > 0);
73 /* We need to hold the inode semaphore over the dcache lookup itself, or we
74 * run the risk of entering the filesystem lookup path concurrently on SMP
75 * systems, and instantiating two inodes for the same entry. We still
76 * protect against concurrent addition/removal races with the DLM locking.
78 static inline struct dentry *ll_lookup_one_len(char *fid_name,
79 struct dentry *dparent,
82 struct dentry *dchild;
84 down(&dparent->d_inode->i_sem);
85 dchild = lookup_one_len(fid_name, dparent, fid_namelen);
86 up(&dparent->d_inode->i_sem);
91 static inline void ll_sleep(int t)
93 set_current_state(TASK_INTERRUPTIBLE);
94 schedule_timeout(t * HZ);
95 set_current_state(TASK_RUNNING);
99 #define LL_FID_NAMELEN (16 + 1 + 8 + 1)
100 static inline int ll_fid2str(char *str, __u64 id, __u32 generation)
102 return sprintf(str, "%llx:%08x", (unsigned long long)id, generation);