#error Unsupported operating system.
#endif
-#include <obd.h>
+#include <obd_class.h>
#include <obd_ost.h>
#include <lustre/lustre_idl.h>
struct llog_rec_hdr *rec, struct lov_stripe_md *lsm,
struct llog_cookie *logcookies, int numcookies);
-int llog_cat_initialize(struct obd_device *obd, struct obd_llog_group *olg,
- int idx, struct obd_uuid *uuid);
int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
- struct obd_device *disk_obd, int count,
- struct llog_catid *logid, struct obd_uuid *uuid);
+ struct obd_device *disk_obd, int *idx);
int obd_llog_finish(struct obd_device *obd, int count);
/* llog_lvfs.c */
extern struct llog_operations llog_lvfs_ops;
-int llog_get_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
+int llog_get_cat_list(struct obd_device *disk_obd,
char *name, int idx, int count,
struct llog_catid *idarray);
-int llog_put_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
+int llog_put_cat_list(struct obd_device *disk_obd,
char *name, int idx, int count, struct llog_catid *idarray);
+#define LLOG_CTXT_FLAG_UNINITIALIZED 0x00000001
+
struct llog_ctxt {
int loc_idx; /* my index the obd array of ctxt's */
struct llog_gen loc_gen;
struct semaphore loc_sem; /* protects loc_llcd and loc_imp */
atomic_t loc_refcount;
void *llog_proc_cb;
+ long loc_flags; /* flags, see above defines */
};
#define LCM_NAME_SIZE 64
*/
atomic_t lcm_count;
/**
+ * The refcount for lcm
+ */
+ atomic_t lcm_refcount;
+ /**
* Thread control structure. Used for control commit thread.
*/
struct ptlrpcd_ctl lcm_pc;
char lcm_name[LCM_NAME_SIZE];
};
+static inline struct llog_commit_master
+*lcm_get(struct llog_commit_master *lcm)
+{
+ LASSERT(atomic_read(&lcm->lcm_refcount) > 0);
+ atomic_inc(&lcm->lcm_refcount);
+ return lcm;
+}
+
+static inline void
+lcm_put(struct llog_commit_master *lcm)
+{
+ if (!atomic_dec_and_test(&lcm->lcm_refcount)) {
+ return ;
+ }
+ OBD_FREE_PTR(lcm);
+}
+
struct llog_canceld_ctxt {
/**
* Llog context this llcd is attached to. Used for accessing
ctxt->loc_gen.mnt_cnt = obd->u.filter.fo_mount_count;
else
ctxt->loc_gen.mnt_cnt = 0;
+ ctxt->loc_gen.conn_cnt++;
}
static inline int llog_gen_lt(struct llog_gen a, struct llog_gen b)
return(a.conn_cnt < b.conn_cnt ? 1 : 0);
}
-#define LLOG_GEN_INC(gen) ((gen).conn_cnt ++)
#define LLOG_PROC_BREAK 0x0001
#define LLOG_DEL_RECORD 0x0002
RETURN(rc);
}
+int lustre_process_log(struct super_block *sb, char *logname,
+ struct config_llog_instance *cfg);
+int lustre_end_log(struct super_block *sb, char *logname,
+ struct config_llog_instance *cfg);
+
#endif