• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/md/

Lines Matching defs: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\"",
84 while (request_module("dm-log-%s", type_name_dup) ||
153 struct dm_dirty_log *log;
155 log = kmalloc(sizeof(*log), GFP_KERNEL);
156 if (!log)
161 kfree(log);
165 log->flush_callback_fn = flush_callback_fn;
166 log->type = type;
167 if (type->ctr(log, ti, argc, argv)) {
168 kfree(log);
173 return log;
177 void dm_dirty_log_destroy(struct dm_dirty_log *log)
179 log->type->dtr(log);
180 put_type(log->type);
181 kfree(log);
233 * Disk log fields
304 static int read_header(struct log_c *log)
308 r = rw_header(log, READ);
312 header_from_disk(&log->header, log->disk_header);
314 /* New log required? */
315 if (log->sync != DEFAULTSYNC || log->header.magic != MIRROR_MAGIC) {
316 log->header.magic = MIRROR_MAGIC;
317 log->header.version = MIRROR_DISK_VERSION;
318 log->header.nr_regions = 0;
322 if (log->header.version == 1)
323 log->header.version = 2;
326 if (log->header.version != MIRROR_DISK_VERSION) {
327 DMWARN("incompatible disk log version");
346 * core log constructor/destructor
351 static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
364 DMWARN("wrong number of arguments to dirty region log");
375 "dirty region log: %s", argv[1]);
390 DMWARN("couldn't allocate core log");
412 * Disk log?
438 DMWARN("log device %s too small: need %llu bytes",
459 DMWARN("couldn't allocate disk log buffer");
500 log->context = lc;
505 static int core_ctr(struct dm_dirty_log *log, struct dm_target *ti,
508 return create_log_context(log, ti, argc, argv, NULL);
518 static void core_dtr(struct dm_dirty_log *log)
520 struct log_c *lc = (struct log_c *) log->context;
527 * disk log constructor/destructor
531 static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti,
538 DMWARN("wrong number of arguments to disk dirty region log");
546 r = create_log_context(log, ti, argc - 1, argv + 1, dev);
555 static void disk_dtr(struct dm_dirty_log *log)
557 struct log_c *lc = (struct log_c *) log->context;
584 static int disk_resume(struct dm_dirty_log *log)
588 struct log_c *lc = (struct log_c *) log->context;
594 DMWARN("%s: Failed to read header on dirty region log device",
598 * If the log device cannot be read, we must assume
637 DMWARN("%s: Failed to write header on dirty region log device",
645 static uint32_t core_get_region_size(struct dm_dirty_log *log)
647 struct log_c *lc = (struct log_c *) log->context;
651 static int core_resume(struct dm_dirty_log *log)
653 struct log_c *lc = (struct log_c *) log->context;
658 static int core_is_clean(struct dm_dirty_log *log, region_t region)
660 struct log_c *lc = (struct log_c *) log->context;
664 static int core_in_sync(struct dm_dirty_log *log, region_t region, int block)
666 struct log_c *lc = (struct log_c *) log->context;
670 static int core_flush(struct dm_dirty_log *log)
676 static int disk_flush(struct dm_dirty_log *log)
679 struct log_c *lc = log->context;
681 /* only write if the log has changed */
685 if (lc->touched_cleaned && log->flush_callback_fn &&
686 log->flush_callback_fn(lc->ti)) {
690 * re-reading the log off disk). So mark all of them
716 static void core_mark_region(struct dm_dirty_log *log, region_t region)
718 struct log_c *lc = (struct log_c *) log->context;
722 static void core_clear_region(struct dm_dirty_log *log, region_t region)
724 struct log_c *lc = (struct log_c *) log->context;
729 static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
731 struct log_c *lc = (struct log_c *) log->context;
752 static void core_set_region_sync(struct dm_dirty_log *log, region_t region,
755 struct log_c *lc = (struct log_c *) log->context;
767 static region_t core_get_sync_count(struct dm_dirty_log *log)
769 struct log_c *lc = (struct log_c *) log->context;
778 static int core_status(struct dm_dirty_log *log, status_type_t status,
782 struct log_c *lc = log->context;
786 DMEMIT("1 %s", log->type->name);
790 DMEMIT("%s %u %u ", log->type->name,
798 static int disk_status(struct dm_dirty_log *log, status_type_t status,
802 struct log_c *lc = log->context;
806 DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name,
813 DMEMIT("%s %u %s %u ", log->type->name,
865 DMWARN("couldn't register core log");
885 MODULE_DESCRIPTION(DM_NAME " dirty region log");