Whamcloud - gitweb
- small fix in mds_lock_mode_for_dir()
[fs/lustre-release.git] / lustre / mds / mds_internal.h
index d29398f..4c39219 100644 (file)
@@ -30,6 +30,33 @@ static inline struct obd_device *req2obd(struct ptlrpc_request *req)
         return req->rq_export->exp_obd;
 }
 
+typedef enum {
+        MDS_OPEN_COUNT         = 0,
+        MDS_CREATE_COUNT       = 1,
+        MDS_CLOSE_COUNT        = 2,
+        MDS_LINK_COUNT         = 3,
+        MDS_UNLINK_COUNT       = 4,
+        MDS_GETATTR_COUNT      = 5,
+        MDS_GETATTR_NAME_COUNT = 6,
+        MDS_SETATTR_COUNT      = 7,
+        MDS_RENAME_COUNT       = 8,
+        MDS_STATFS_COUNT       = 9,
+        MDS_LAST_OPC_COUNT     = 10
+} mds_counters_t;
+
+struct lprocfs_stats * lprocfs_alloc_mds_counters(void);
+void lprocfs_free_mds_counters(struct lprocfs_stats *ptr);
+
+#ifndef LPROCFS
+#define MDS_UPDATE_COUNTER(mds, opcode) do {} while (0)
+#else
+
+#define MDS_UPDATE_COUNTER(mds, opcode) \
+        LASSERT( opcode < MDS_LAST_OPC_COUNT); \
+        LASSERT( mds->mds_counters != NULL); \
+        lprocfs_counter_incr(mds->mds_counters, opcode);
+#endif
+
 /* mds/mds_reint.c */
 int enqueue_ordered_locks(struct obd_device *obd, struct ldlm_res_id *p1_res_id,
                           struct lustre_handle *p1_lockh, int p1_lock_mode,
@@ -68,7 +95,8 @@ int mds_cleanup_orphans(struct obd_device *obd);
 /* mds/mds_log.c */
 int mds_log_op_unlink(struct obd_device *obd, struct inode *inode,
                       struct lov_mds_md *lmm, int lmm_size,
-                      struct llog_cookie *logcookies, int cookies_size);
+                      struct llog_cookie *logcookies, int cookies_size,
+                      struct llog_create_locks **res);
 int mds_llog_init(struct obd_device *obd, struct obd_llogs *,
                   struct obd_device *tgt, int count, struct llog_catid *logid);
 int mds_llog_finish(struct obd_device *obd, struct obd_llogs *, int count);
@@ -76,6 +104,8 @@ int mds_llog_finish(struct obd_device *obd, struct obd_llogs *, int count);
 /* mds/mds_lov.c */
 int mds_lov_connect(struct obd_device *obd, char * lov_name);
 int mds_lov_disconnect(struct obd_device *obd, int flags);
+int mds_lov_set_info(struct obd_export *exp, obd_count keylen,
+                     void *key, obd_count vallen, void *val);
 int mds_get_lovtgts(struct obd_device *, int tgt_count, struct obd_uuid *);
 int mds_lov_write_objids(struct obd_device *obd);
 void mds_lov_update_objids(struct obd_device *obd, obd_id *ids);
@@ -83,7 +113,8 @@ int mds_lov_set_growth(struct mds_obd *mds, int count);
 int mds_lov_set_nextid(struct obd_device *obd);
 int mds_lov_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
 int mds_post_mds_lovconf(struct obd_device *obd);
-int mds_notify(struct obd_device *obd, struct obd_device *watched, int active);
+int mds_notify(struct obd_device *obd, struct obd_device *watched,
+               int active, void *data);
 int mds_lov_update_config(struct obd_device *obd, int transno);
 int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
                        struct lov_mds_md *lmm, int lmm_size);
@@ -111,6 +142,7 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
                     struct lov_stripe_md *ea, struct obd_trans_info *oti);
 
 /* mds/handler.c */
+int mds_handle(struct ptlrpc_request *req);
 extern struct lvfs_callback_ops mds_lvfs_ops;
 int mds_lov_clean(struct obd_device *obd);
 extern int mds_iocontrol(unsigned int cmd, struct obd_export *exp,
@@ -145,6 +177,7 @@ int mds_unlink_slave_objs(struct obd_device *, struct dentry *);
 void mds_unlock_slave_objs(struct obd_device *, struct dentry *,
                            struct lustre_handle *);
 int mds_lock_and_check_slave(int, struct ptlrpc_request *, struct lustre_handle *);
+int mds_convert_mea_ea(struct obd_device *, struct inode *, struct lov_mds_md *, int);
 
 
 #endif /* _MDS_INTERNAL_H */