Lines Matching refs:log

154 	struct dm_dirty_log *log;  in dm_dirty_log_create()  local
156 log = kmalloc(sizeof(*log), GFP_KERNEL); in dm_dirty_log_create()
157 if (!log) in dm_dirty_log_create()
162 kfree(log); in dm_dirty_log_create()
166 log->flush_callback_fn = flush_callback_fn; in dm_dirty_log_create()
167 log->type = type; in dm_dirty_log_create()
168 if (type->ctr(log, ti, argc, argv)) { in dm_dirty_log_create()
169 kfree(log); in dm_dirty_log_create()
174 return log; in dm_dirty_log_create()
178 void dm_dirty_log_destroy(struct dm_dirty_log *log) in dm_dirty_log_destroy() argument
180 log->type->dtr(log); in dm_dirty_log_destroy()
181 put_type(log->type); in dm_dirty_log_destroy()
182 kfree(log); in dm_dirty_log_destroy()
319 static int read_header(struct log_c *log) in read_header() argument
323 r = rw_header(log, REQ_OP_READ); in read_header()
327 header_from_disk(&log->header, log->disk_header); in read_header()
330 if (log->sync != DEFAULTSYNC || log->header.magic != MIRROR_MAGIC) { in read_header()
331 log->header.magic = MIRROR_MAGIC; in read_header()
332 log->header.version = MIRROR_DISK_VERSION; in read_header()
333 log->header.nr_regions = 0; in read_header()
337 if (log->header.version == 1) in read_header()
338 log->header.version = 2; in read_header()
341 if (log->header.version != MIRROR_DISK_VERSION) { in read_header()
368 static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, in create_log_context() argument
513 log->context = lc; in create_log_context()
518 static int core_ctr(struct dm_dirty_log *log, struct dm_target *ti, in core_ctr() argument
521 return create_log_context(log, ti, argc, argv, NULL); in core_ctr()
531 static void core_dtr(struct dm_dirty_log *log) in core_dtr() argument
533 struct log_c *lc = (struct log_c *) log->context; in core_dtr()
546 static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti, in disk_ctr() argument
561 r = create_log_context(log, ti, argc - 1, argv + 1, dev); in disk_ctr()
570 static void disk_dtr(struct dm_dirty_log *log) in disk_dtr() argument
572 struct log_c *lc = (struct log_c *) log->context; in disk_dtr()
589 static int disk_resume(struct dm_dirty_log *log) in disk_resume() argument
593 struct log_c *lc = (struct log_c *) log->context; in disk_resume()
653 static uint32_t core_get_region_size(struct dm_dirty_log *log) in core_get_region_size() argument
655 struct log_c *lc = (struct log_c *) log->context; in core_get_region_size()
660 static int core_resume(struct dm_dirty_log *log) in core_resume() argument
662 struct log_c *lc = (struct log_c *) log->context; in core_resume()
668 static int core_is_clean(struct dm_dirty_log *log, region_t region) in core_is_clean() argument
670 struct log_c *lc = (struct log_c *) log->context; in core_is_clean()
675 static int core_in_sync(struct dm_dirty_log *log, region_t region, int block) in core_in_sync() argument
677 struct log_c *lc = (struct log_c *) log->context; in core_in_sync()
682 static int core_flush(struct dm_dirty_log *log) in core_flush() argument
688 static int disk_flush(struct dm_dirty_log *log) in disk_flush() argument
691 struct log_c *lc = log->context; in disk_flush()
697 if (lc->touched_cleaned && log->flush_callback_fn && in disk_flush()
698 log->flush_callback_fn(lc->ti)) { in disk_flush()
728 static void core_mark_region(struct dm_dirty_log *log, region_t region) in core_mark_region() argument
730 struct log_c *lc = (struct log_c *) log->context; in core_mark_region()
735 static void core_clear_region(struct dm_dirty_log *log, region_t region) in core_clear_region() argument
737 struct log_c *lc = (struct log_c *) log->context; in core_clear_region()
743 static int core_get_resync_work(struct dm_dirty_log *log, region_t *region) in core_get_resync_work() argument
745 struct log_c *lc = (struct log_c *) log->context; in core_get_resync_work()
765 static void core_set_region_sync(struct dm_dirty_log *log, region_t region, in core_set_region_sync() argument
768 struct log_c *lc = (struct log_c *) log->context; in core_set_region_sync()
780 static region_t core_get_sync_count(struct dm_dirty_log *log) in core_get_sync_count() argument
782 struct log_c *lc = (struct log_c *) log->context; in core_get_sync_count()
793 static int core_status(struct dm_dirty_log *log, status_type_t status, in core_status() argument
797 struct log_c *lc = log->context; in core_status()
801 DMEMIT("1 %s", log->type->name); in core_status()
805 DMEMIT("%s %u %u ", log->type->name, in core_status()
818 static int disk_status(struct dm_dirty_log *log, status_type_t status, in disk_status() argument
822 struct log_c *lc = log->context; in disk_status()
826 DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name, in disk_status()
833 DMEMIT("%s %u %s %u ", log->type->name, in disk_status()