6 #include <linux/obd_class.h>
7 #include <portals/procbridge.h>
8 #include <linux/lustre_lite.h>
10 #include <sys/types.h>
14 struct obd_client_handle fd_mds_och;
15 struct obd_client_handle fd_ost_och;
21 struct obd_uuid ll_sb_uuid;
22 struct lustre_handle ll_mdc_conn;
23 struct lustre_handle ll_osc_conn;
26 struct list_head ll_conn_chain;
29 struct llu_inode_info {
30 struct llu_sb_info *lli_sbi;
31 struct ll_fid lli_fid;
32 struct lov_stripe_md *lli_smd;
33 char *lli_symlink_name;
34 /*struct semaphore lli_open_sem;*/
35 unsigned long lli_flags;
36 struct list_head lli_read_extents;
38 /* in libsysio we have no chance to store data in file,
40 struct ll_file_data *lli_file_data;
42 /* stat FIXME not 64 bit clean */
51 unsigned int lli_st_blksize;
52 unsigned int lli_st_blocks;
57 /* not for stat, change it later */
59 unsigned long lli_st_generation;
62 static inline struct llu_sb_info *llu_fs2sbi(struct filesys *fs)
64 return (struct llu_sb_info*)(fs->fs_private);
67 static inline struct llu_inode_info *llu_i2info(struct inode *inode)
69 return (struct llu_inode_info*)(inode->i_private);
72 static inline struct llu_sb_info *llu_i2sbi(struct inode *inode)
74 return llu_i2info(inode)->lli_sbi;
77 static inline struct client_obd *sbi2mdc(struct llu_sb_info *sbi)
79 struct obd_device *obd = class_conn2obd(&sbi->ll_mdc_conn);
85 static inline struct lustre_handle *llu_i2obdconn(struct inode *inode)
87 return &(llu_i2info(inode)->lli_sbi->ll_osc_conn);
98 void generate_random_uuid(unsigned char uuid_out[16]);
100 extern struct mount_option_s mount_option;
103 void llu_update_inode(struct inode *inode, struct mds_body *body,
104 struct lov_stripe_md *lmm);
105 void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
106 void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid);
107 struct inode* llu_new_inode(struct filesys *fs, ino_t ino, mode_t mode);
109 extern struct fssw_ops llu_fssw_ops;
112 void llu_prepare_mdc_op_data(struct mdc_op_data *data,
118 int llu_create(struct inode *dir, struct pnode_base *pnode, int mode);
119 int llu_iop_open(struct pnode *pnode, int flags, mode_t mode);
120 int llu_iop_close(struct inode *inode);
121 int llu_iop_ipreadv(struct inode *ino,
122 struct io_arguments *ioargs,
123 struct ioctx **ioctxp);
124 int llu_iop_ipwritev(struct inode *ino,
125 struct io_arguments *ioargs,
126 struct ioctx **ioctxp);
129 int llu_iop_iodone(struct ioctx *ioctxp __IS_UNUSED);
130 ssize_t llu_file_write(struct inode *inode, const struct iovec *iovec,
131 size_t iovlen, loff_t pos);
132 ssize_t llu_file_read(struct inode *inode, const struct iovec *iovec,
133 size_t iovlen, loff_t pos);