From patchwork Tue Mar 16 15:33:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: heinzm@sourceware.org X-Patchwork-Id: 86160 Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2GFaop7014771 for ; Tue, 16 Mar 2010 15:37:27 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2GFYBD2015432; Tue, 16 Mar 2010 11:34:12 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2GFY8tZ014904 for ; Tue, 16 Mar 2010 11:34:08 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2GFY3Ul024067 for ; Tue, 16 Mar 2010 11:34:03 -0400 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id o2GFXpmH029568 for ; Tue, 16 Mar 2010 11:33:51 -0400 Received: (qmail 17173 invoked by uid 9450); 16 Mar 2010 15:33:51 -0000 Date: 16 Mar 2010 15:33:51 -0000 Message-ID: <20100316153351.17171.qmail@sourceware.org> From: heinzm@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.12 X-loop: dm-devel@redhat.com Subject: [dm-devel] dmraid/lib/events libdmraid-events-isw.c X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 16 Mar 2010 15:37:27 +0000 (UTC) --- dmraid/lib/events/libdmraid-events-isw.c 2009/11/19 11:37:25 1.2 +++ dmraid/lib/events/libdmraid-events-isw.c 2010/03/16 15:33:50 1.3 @@ -27,20 +27,8 @@ */ /* - * FIXME before releasing in RHEL5 (Heinz Mauelshagen): - * - * o symbols naming consistency - * - * Likely after 5.3: - * o integrate code with dmraid package - * o support metadata updates - * o use libsysfs rather than duplicated code to access sysfs - * o remove any limitations to SATA, because dmraid must be device agnostic; - * ie. the devices being registered with dmeventd have to be derived from - * libdmraid metadata discovery; this essentially means a rewrite! - * * FIXED: - * o stremaline event processing functions + * o streamline event processing functions * o register/event processing major:minor usage concept * o cover error paths * o locking race vs. registration in event processing @@ -101,13 +89,11 @@ static const char *default_dmraid_events_lib = "libdmraid-events.so"; static const char *sys_dm_dm = "dm-"; static const char *sys_block_path = "/sys/block/"; -static const char *sys_dm_path = "/sys/block/dm-"; static const char *sys_scsi_path = "/sys/class/scsi_device/"; static const char *sys_slaves_dir = "/slaves"; static const char *sys_scsi_dev_blk = "/device/block"; static const char sys_scsi_dev_blk_delims[] = { '/', ':' }; static const char *sys_dev_dir = "/dev"; -static const char *syslog_ident = "libdmraid-events"; /* Logging. */ enum log_type { LOG_NAMES, LOG_PORTS, LOG_OPEN_FAILURE, LOG_NONE }; @@ -1070,7 +1056,7 @@ char *params) { int argc, i, num_devs, ret = D_INSYNC; - char **args, *dev_status_str, *p; + char **args = NULL, *dev_status_str, *p; const char *rs_name = dm_task_get_name(dmt); struct dso_raid_set *rs = _find_raid_set(rs_name, NULL, 1); struct dso_raid_dev *dev; @@ -1135,7 +1121,7 @@ { int argc, i, log_argc, num_devs, ret = D_INSYNC; char **args = NULL, *dev_status_str, - *log_status_str, *p, *sync_str; + *log_status_str = NULL, *p, *sync_str; const char *rs_name = dm_task_get_name(dmt); struct dso_raid_set *rs = _find_raid_set(rs_name, NULL, 1); @@ -1517,16 +1503,17 @@ * * Return 1 for success and 0 for failure. */ -int register_device(const char *rs_name, const char *uuid, +int register_device(const char *rs_name_in, const char *uuid, int major, int minor, void **unused __attribute((unused))) { + char *rs_name; struct dso_raid_set *rs, *rs_new; /* FIXME: need to run first to get syslog() to work. */ _check_sgpio(); - rs_name = basename(rs_name); + rs_name = basename((char *) rs_name_in); /* Check for double registration attempt. */ pthread_mutex_lock(&_register_mutex); @@ -1581,13 +1568,14 @@ * * Return 1 for success and 0 for failure. */ -int unregister_device(const char *rs_name, const char *uuid, +int unregister_device(const char *rs_name_in, const char *uuid, int major, int minor, void **unused __attribute((unused))) { + char *rs_name; struct dso_raid_set *prev, *rs; - rs_name = basename(rs_name); + rs_name = basename((char *) rs_name_in); pthread_mutex_lock(&_register_mutex);