Lines Matching defs:lc
56 static int userspace_do_request(struct log_c *lc, const char *uuid,
68 r = dm_consult_userspace(uuid, lc->luid, request_type, data,
79 r = dm_consult_userspace(uuid, lc->luid, DM_ULOG_CTR,
80 lc->usr_argv_str,
81 strlen(lc->usr_argv_str) + 1,
87 r = dm_consult_userspace(uuid, lc->luid, DM_ULOG_RESUME, NULL,
144 struct log_c *lc = NULL;
153 lc = kmalloc(sizeof(*lc), GFP_KERNEL);
154 if (!lc) {
160 lc->luid = (unsigned long)lc;
162 lc->ti = ti;
166 kfree(lc);
170 strncpy(lc->uuid, argv[0], DM_UUID_LEN);
171 spin_lock_init(&lc->flush_lock);
172 INIT_LIST_HEAD(&lc->flush_list);
176 kfree(lc);
181 r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_CTR,
191 r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_GET_REGION_SIZE,
199 lc->region_size = (uint32_t)rdata;
200 lc->region_count = dm_sector_div_up(ti->len, lc->region_size);
204 kfree(lc);
207 lc->usr_argv_str = ctr_str;
208 lc->usr_argc = argc;
209 log->context = lc;
218 struct log_c *lc = log->context;
220 r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_DTR,
224 kfree(lc->usr_argv_str);
225 kfree(lc);
233 struct log_c *lc = log->context;
235 r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_PRESUSPEND,
245 struct log_c *lc = log->context;
247 r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_POSTSUSPEND,
257 struct log_c *lc = log->context;
259 lc->in_sync_hint = 0;
260 r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_RESUME,
269 struct log_c *lc = log->context;
271 return lc->region_size;
288 struct log_c *lc = log->context;
291 r = userspace_do_request(lc, lc->uuid, DM_ULOG_IS_CLEAN,
316 struct log_c *lc = log->context;
335 r = userspace_do_request(lc, lc->uuid, DM_ULOG_IN_SYNC,
362 struct log_c *lc = log->context;
366 spin_lock_irqsave(&lc->flush_lock, flags);
367 list_splice_init(&lc->flush_list, &flush_list);
368 spin_unlock_irqrestore(&lc->flush_lock, flags);
375 r = userspace_do_request(lc, lc->uuid, fe->type,
383 r = userspace_do_request(lc, lc->uuid, DM_ULOG_FLUSH,
398 dm_table_event(lc->ti->table);
412 struct log_c *lc = log->context;
419 spin_lock_irqsave(&lc->flush_lock, flags);
422 list_add(&fe->list, &lc->flush_list);
423 spin_unlock_irqrestore(&lc->flush_lock, flags);
441 struct log_c *lc = log->context;
456 spin_lock_irqsave(&lc->flush_lock, flags);
459 list_add(&fe->list, &lc->flush_list);
460 spin_unlock_irqrestore(&lc->flush_lock, flags);
477 struct log_c *lc = log->context;
483 if (lc->in_sync_hint >= lc->region_count)
487 r = userspace_do_request(lc, lc->uuid, DM_ULOG_GET_RESYNC_WORK,
505 struct log_c *lc = log->context;
514 r = userspace_do_request(lc, lc->uuid, DM_ULOG_SET_REGION_SYNC,
538 struct log_c *lc = log->context;
541 r = userspace_do_request(lc, lc->uuid, DM_ULOG_GET_SYNC_COUNT,
548 if (sync_count >= lc->region_count)
549 lc->in_sync_hint = lc->region_count;
565 struct log_c *lc = log->context;
569 r = userspace_do_request(lc, lc->uuid, DM_ULOG_STATUS_INFO,
580 table_args = strchr(lc->usr_argv_str, ' ');
584 DMEMIT("%s %u %s %s ", log->type->name, lc->usr_argc,
585 lc->uuid, table_args);
601 struct log_c *lc = log->context;
616 if (region < lc->in_sync_hint)
622 r = userspace_do_request(lc, lc->uuid, DM_ULOG_IS_REMOTE_RECOVERING,
628 lc->in_sync_hint = pkg.in_sync_hint;