• Home
  • Raw
  • Download

Lines Matching full:log

13 #include <linux/dm-dirty-log.h>
17 #define DM_MSG_PREFIX "dirty region log"
55 * Log modules are named "dm-log-" followed by the 'type_name'.
57 * This function will first try the module "dm-log-<type_name>",
61 * 'dm-log-clustered-disk' then 'dm-log-clustered'.
79 DMWARN("No memory left to attempt log module load for \"%s\"", in get_type()
84 while (request_module("dm-log-%s", type_name_dup) || in get_type()
153 struct dm_dirty_log *log; in dm_dirty_log_create() local
155 log = kmalloc(sizeof(*log), GFP_KERNEL); in dm_dirty_log_create()
156 if (!log) in dm_dirty_log_create()
161 kfree(log); in dm_dirty_log_create()
165 log->flush_callback_fn = flush_callback_fn; in dm_dirty_log_create()
166 log->type = type; in dm_dirty_log_create()
167 if (type->ctr(log, ti, argc, argv)) { in dm_dirty_log_create()
168 kfree(log); in dm_dirty_log_create()
173 return log; in dm_dirty_log_create()
177 void dm_dirty_log_destroy(struct dm_dirty_log *log) in dm_dirty_log_destroy() argument
179 log->type->dtr(log); in dm_dirty_log_destroy()
180 put_type(log->type); in dm_dirty_log_destroy()
181 kfree(log); in dm_dirty_log_destroy()
243 * Disk log fields
316 static int read_header(struct log_c *log) in read_header() argument
320 r = rw_header(log, REQ_OP_READ); in read_header()
324 header_from_disk(&log->header, log->disk_header); in read_header()
326 /* New log required? */ in read_header()
327 if (log->sync != DEFAULTSYNC || log->header.magic != MIRROR_MAGIC) { in read_header()
328 log->header.magic = MIRROR_MAGIC; in read_header()
329 log->header.version = MIRROR_DISK_VERSION; in read_header()
330 log->header.nr_regions = 0; in read_header()
334 if (log->header.version == 1) in read_header()
335 log->header.version = 2; in read_header()
338 if (log->header.version != MIRROR_DISK_VERSION) { in read_header()
339 DMWARN("incompatible disk log version"); in read_header()
358 * core log constructor/destructor
363 static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, in create_log_context() argument
377 DMWARN("wrong number of arguments to dirty region log"); in create_log_context()
388 "dirty region log: %s", argv[1]); in create_log_context()
403 DMWARN("couldn't allocate core log"); in create_log_context()
424 * Disk log? in create_log_context()
450 DMWARN("log device %s too small: need %llu bytes", in create_log_context()
470 DMWARN("couldn't allocate disk log buffer"); in create_log_context()
510 log->context = lc; in create_log_context()
515 static int core_ctr(struct dm_dirty_log *log, struct dm_target *ti, in core_ctr() argument
518 return create_log_context(log, ti, argc, argv, NULL); in core_ctr()
528 static void core_dtr(struct dm_dirty_log *log) in core_dtr() argument
530 struct log_c *lc = (struct log_c *) log->context; in core_dtr()
537 * disk log constructor/destructor
541 static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti, in disk_ctr() argument
548 DMWARN("wrong number of arguments to disk dirty region log"); in disk_ctr()
556 r = create_log_context(log, ti, argc - 1, argv + 1, dev); in disk_ctr()
565 static void disk_dtr(struct dm_dirty_log *log) in disk_dtr() argument
567 struct log_c *lc = (struct log_c *) log->context; in disk_dtr()
584 static int disk_resume(struct dm_dirty_log *log) in disk_resume() argument
588 struct log_c *lc = (struct log_c *) log->context; in disk_resume()
594 DMWARN("%s: Failed to read header on dirty region log device", in disk_resume()
598 * If the log device cannot be read, we must assume in disk_resume()
640 DMWARN("%s: Failed to write header on dirty region log device", in disk_resume()
648 static uint32_t core_get_region_size(struct dm_dirty_log *log) in core_get_region_size() argument
650 struct log_c *lc = (struct log_c *) log->context; in core_get_region_size()
654 static int core_resume(struct dm_dirty_log *log) in core_resume() argument
656 struct log_c *lc = (struct log_c *) log->context; in core_resume()
661 static int core_is_clean(struct dm_dirty_log *log, region_t region) in core_is_clean() argument
663 struct log_c *lc = (struct log_c *) log->context; in core_is_clean()
667 static int core_in_sync(struct dm_dirty_log *log, region_t region, int block) in core_in_sync() argument
669 struct log_c *lc = (struct log_c *) log->context; in core_in_sync()
673 static int core_flush(struct dm_dirty_log *log) in core_flush() argument
679 static int disk_flush(struct dm_dirty_log *log) in disk_flush() argument
682 struct log_c *lc = log->context; in disk_flush()
684 /* only write if the log has changed */ in disk_flush()
688 if (lc->touched_cleaned && log->flush_callback_fn && in disk_flush()
689 log->flush_callback_fn(lc->ti)) { in disk_flush()
693 * re-reading the log off disk). So mark all of them in disk_flush()
719 static void core_mark_region(struct dm_dirty_log *log, region_t region) in core_mark_region() argument
721 struct log_c *lc = (struct log_c *) log->context; in core_mark_region()
725 static void core_clear_region(struct dm_dirty_log *log, region_t region) in core_clear_region() argument
727 struct log_c *lc = (struct log_c *) log->context; in core_clear_region()
732 static int core_get_resync_work(struct dm_dirty_log *log, region_t *region) in core_get_resync_work() argument
734 struct log_c *lc = (struct log_c *) log->context; in core_get_resync_work()
754 static void core_set_region_sync(struct dm_dirty_log *log, region_t region, in core_set_region_sync() argument
757 struct log_c *lc = (struct log_c *) log->context; in core_set_region_sync()
769 static region_t core_get_sync_count(struct dm_dirty_log *log) in core_get_sync_count() argument
771 struct log_c *lc = (struct log_c *) log->context; in core_get_sync_count()
780 static int core_status(struct dm_dirty_log *log, status_type_t status, in core_status() argument
784 struct log_c *lc = log->context; in core_status()
788 DMEMIT("1 %s", log->type->name); in core_status()
792 DMEMIT("%s %u %u ", log->type->name, in core_status()
800 static int disk_status(struct dm_dirty_log *log, status_type_t status, in disk_status() argument
804 struct log_c *lc = log->context; in disk_status()
808 DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name, in disk_status()
815 DMEMIT("%s %u %s %u ", log->type->name, in disk_status()
867 DMWARN("couldn't register core log"); in dm_dirty_log_init()
887 MODULE_DESCRIPTION(DM_NAME " dirty region log");