c - Where is the implementation of dm_task_create in cryptsetup? -


where implementation of function dm_task_create in cryptsetup (and other dm_task_ related functions)? grepping function in source cryptsetup come nothing. see used in lib/libdevmapper.c , has function prototype in libdevmapper.h. implementation? side note, cryptsetup compiles fine , executes.

just check, grepped through kernel source doesn't appear implemented in kernel either.

from following link http://www.saout.de/pipermail/dm-crypt/2009-december/000464.html appears @ least in past implemented in libdevmapper.c.

it's implemented in libdm-common.c, part of libdm (lib device-mapper). not implemented part of cryptsetup itself.

this code maintained alongside lvm2, documented on this page:

the userspace code (dmsetup , libdevmapper) maintained alongside lvm2 source available http://sources.redhat.com/lvm2/. build / install without lvm2 use 'make device-mapper' / 'make device-mapper_install'.


here's implementation:

struct dm_task *dm_task_create(int type) {     struct dm_task *dmt = dm_zalloc(sizeof(*dmt));      if (!dmt) {         log_error("dm_task_create: malloc(%" prisize_t ") failed",               sizeof(*dmt));         return null;     }      if (!dm_check_version()) {         dm_free(dmt);         return_null;     }      dmt->type = type;     dmt->minor = -1;     dmt->major = -1;     dmt->allow_default_major_fallback = 1;     dmt->uid = dm_device_uid;     dmt->gid = dm_device_gid;     dmt->mode = dm_device_mode;     dmt->no_open_count = 0;     dmt->read_ahead = dm_read_ahead_auto;     dmt->read_ahead_flags = 0;     dmt->event_nr = 0;     dmt->cookie_set = 0;     dmt->query_inactive_table = 0;     dmt->new_uuid = 0;     dmt->secure_data = 0;      return dmt; } 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -