Whamcloud - gitweb
land v0.9.1 on HEAD, in preparation for a 1.0.x branch
[fs/lustre-release.git] / lustre / mds / mds_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef _MDS_INTERNAL_H
6 #define _MDS_INTERNAL_H
7
8 #include <linux/lustre_mds.h>
9
10 struct mds_filter_data {
11         __u64 io_epoch;
12 };
13
14 #define MDS_FILTERDATA(inode) ((struct mds_filter_data *)(inode)->i_filterdata)
15
16 static inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req)
17 {
18         return &req->rq_export->exp_obd->u.mds;
19 }
20
21 /* mds/mds_reint.c */
22 void mds_commit_cb(struct obd_device *, __u64 last_rcvd, void *data, int error);
23 int mds_finish_transno(struct mds_obd *mds, struct inode *inode, void *handle,
24                        struct ptlrpc_request *req, int rc, __u32 op_data);
25 void mds_reconstruct_generic(struct ptlrpc_request *req);
26 void mds_req_from_mcd(struct ptlrpc_request *req, struct mds_client_data *mcd);
27
28 /* mds/mds_lib.c */
29 int mds_update_unpack(struct ptlrpc_request *, int offset,
30                       struct mds_update_record *);
31
32 /* mds/mds_unlink_open.c */
33 int mds_open_unlink_rename(struct mds_update_record *rec,
34                            struct obd_device *obd, struct dentry *dparent,
35                            struct dentry *dchild, void **handle);
36 int mds_cleanup_orphans(struct obd_device *obd);
37
38
39 /* mds/mds_log.c */
40 int mds_log_op_unlink(struct obd_device *obd, struct inode *inode, 
41                       struct lustre_msg *repmsg, int offset);
42 int mds_llog_init(struct obd_device *obd, struct obd_device *tgt, int count, 
43                   struct llog_logid *logid);
44 int mds_llog_finish(struct obd_device *obd, int count);
45
46 /* mds/mds_lov.c */
47 int mds_lov_connect(struct obd_device *obd, char * lov_name);
48 int mds_lov_disconnect(struct obd_device *obd, int flags);
49 int mds_get_lovtgts(struct obd_device *, int tgt_count, struct obd_uuid *);
50 int mds_lov_write_objids(struct obd_device *obd);
51 void mds_lov_update_objids(struct obd_device *obd, obd_id *ids);
52 int mds_lov_set_growth(struct mds_obd *mds, int count);
53 int mds_lov_set_nextid(struct obd_device *obd);
54 int mds_post_mds_lovconf(struct obd_device *obd);
55 int mds_notify(struct obd_device *obd, struct obd_device *watched, int active);
56 int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
57                        struct lov_mds_md *lmm, int lmm_size);
58
59 /* mds/mds_open.c */
60 int mds_query_write_access(struct inode *inode);
61 int mds_open(struct mds_update_record *rec, int offset,
62              struct ptlrpc_request *req, struct lustre_handle *);
63 int mds_pin(struct ptlrpc_request *req);
64 int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd,
65                   struct mds_file_data *mfd, int unlink_orphan);
66 int mds_close(struct ptlrpc_request *req);
67 int mds_done_writing(struct ptlrpc_request *req);
68
69
70 /* mds/mds_fs.c */
71 int mds_client_add(struct obd_device *obd, struct mds_obd *mds,
72                    struct mds_export_data *med, int cl_off);
73 int mds_client_free(struct obd_export *exp, int clear_client);
74 int mds_obd_create(struct obd_export *exp, struct obdo *oa,
75                       struct lov_stripe_md **ea, struct obd_trans_info *oti);
76 int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
77                     struct lov_stripe_md *ea, struct obd_trans_info *oti);
78
79 /* mds/handler.c */
80 extern struct lvfs_callback_ops mds_lvfs_ops;
81 int mds_lov_clean(struct obd_device *obd);
82 extern int mds_iocontrol(unsigned int cmd, struct obd_export *exp,
83                          int len, void *karg, void *uarg);
84 #ifdef __KERNEL__
85 int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset,
86                 struct mds_body *, struct inode *, int lock);
87 void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode);
88 void mds_pack_inode2body(struct mds_body *body, struct inode *inode);
89 #endif
90
91 #endif /* _MDS_INTERNAL_H */