diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/AIXlvm_vge.c linux-2.4.19-evms-1.2.1/drivers/evms/AIXlvm_vge.c --- linux-2.4.19-evms-1.2.0/drivers/evms/AIXlvm_vge.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/AIXlvm_vge.c Wed Dec 18 14:51:48 2002 @@ -260,7 +260,7 @@ .version = { .major = 1, .minor = 1, - .patchlevel = 1}, + .patchlevel = 2}, .required_services_version = { .major = AIX_COMMON_SERVICES_MAJOR, .minor = AIX_COMMON_SERVICES_MINOR, @@ -1952,7 +1952,7 @@ SLAB_CTOR_CONSTRUCTOR) { struct aix_mirror_bh *rbh = (struct aix_mirror_bh *) foo; memset(rbh, 0, sizeof (struct aix_mirror_bh)); - rbh->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&rbh->remaining, 0); init_waitqueue_head(&rbh->bh_req.b_wait); } } @@ -2573,7 +2573,7 @@ head_bh->master_bh = bh; head_bh->mirror_bh_list = NULL; - head_bh->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&head_bh->remaining, 0); for (i = AIX_DEFAULT_MIRRORING; i <= mirror_copies; i++) { @@ -2591,7 +2591,7 @@ atomic_inc(&head_bh->remaining); memcpy(&tmp_bh->bh_req, bh, sizeof (struct buffer_head)); - tmp_bh->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&tmp_bh->remaining, 0); init_waitqueue_head(&tmp_bh->bh_req.b_wait); //tmp_bh->bh_req.b_size = bh->b_size; @@ -2712,7 +2712,7 @@ } memcpy(&tmp_bh->bh_req, bh, sizeof (struct buffer_head)); - tmp_bh->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&tmp_bh->remaining, 0); tmp_bh->node = node; tmp_bh->master_bh = bh; tmp_bh->iteration = AIX_FIRST_MIRROR; @@ -3308,7 +3308,7 @@ memset(head_bh->bh_req.b_data, 0, AIX_RESYNC_BLOCKSIZE + 1); - head_bh->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&head_bh->remaining, 0); head_bh->bh_req.b_rsector = master_offset; head_bh->bh_req.b_size = AIX_RESYNC_BLOCKSIZE; head_bh->sync_flag = AIX_SYNC_INCOMPLETE; @@ -3332,7 +3332,7 @@ head_bh->next_r1 = tmp_bh; memcpy(&tmp_bh->bh_req, head_bh, sizeof (struct buffer_head)); - tmp_bh->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&tmp_bh->remaining, 0); tmp_bh->bh_req.b_end_io = NULL; if (volume->mirror_copies == AIX_MAX_MIRRORS) { @@ -3349,7 +3349,7 @@ memcpy(&tmp_bh->next_r1->bh_req, head_bh, sizeof (struct buffer_head)); tmp_bh->next_r1->bh_req.b_end_io = NULL; - tmp_bh->next_r1->remaining = (atomic_t) ATOMIC_INIT(0); + atomic_set(&tmp_bh->next_r1->remaining, 0); } init_waitqueue_head(&head_bh->bh_req.b_wait); diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/Config.in linux-2.4.19-evms-1.2.1/drivers/evms/Config.in --- linux-2.4.19-evms-1.2.0/drivers/evms/Config.in Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/Config.in Wed Dec 18 14:51:48 2002 @@ -40,7 +40,6 @@ dep_tristate ' EVMS MD RAID-4/RAID-5 mode' CONFIG_EVMS_MD_RAID5 $CONFIG_EVMS_MD dep_tristate ' EVMS AIX LVM Package' CONFIG_EVMS_AIX $CONFIG_EVMS dep_tristate ' EVMS OS/2 LVM Package' CONFIG_EVMS_OS2 $CONFIG_EVMS -#dep_tristate ' EVMS Clustering Package' CONFIG_EVMS_ECR $CONFIG_EVMS if [ "$CONFIG_EVMS" != "n" ]; then choice ' EVMS Debug Level' \ diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/Makefile linux-2.4.19-evms-1.2.1/drivers/evms/Makefile --- linux-2.4.19-evms-1.2.0/drivers/evms/Makefile Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/Makefile Wed Dec 18 14:51:48 2002 @@ -8,7 +8,7 @@ export-objs := evms.o evms_passthru.o ldev_mgr.o dos_part.o lvm_vge.o \ snapshot.o evms_drivelink.o evms_bbr.o AIXlvm_vge.o \ - os2lvm_vge.o evms_ecr.o md_core.o md_linear.o md_raid0.o \ + os2lvm_vge.o md_core.o md_linear.o md_raid0.o \ md_raid1.o md_raid5.o md_xor.o s390_part.o gpt_part.o # Link order is important! Plugins must come first, then the EVMS core. @@ -28,7 +28,6 @@ obj-$(CONFIG_EVMS_DRIVELINK) += evms_drivelink.o obj-$(CONFIG_EVMS_BBR) += evms_bbr.o obj-$(CONFIG_EVMS_SNAPSHOT) += snapshot.o -obj-$(CONFIG_EVMS_ECR) += evms_ecr.o obj-$(CONFIG_EVMS) += evms_passthru.o evms.o EXTRA_CFLAGS=-DEVMS_INFO_LEVEL=EVMS_INFO_DEFAULT diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/dos_part.c linux-2.4.19-evms-1.2.1/drivers/evms/dos_part.c --- linux-2.4.19-evms-1.2.0/drivers/evms/dos_part.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/dos_part.c Wed Dec 18 14:51:48 2002 @@ -150,7 +150,7 @@ .version = { .major = 1, .minor = 1, - .patchlevel = 1 + .patchlevel = 2 }, .required_services_version = { .major = 0, @@ -613,25 +613,22 @@ return rc; } -static void +static inline void print_partition_info(char *leading_comment, struct partition *p) { - LOG_EXTRA - ("%s: boot_ind(0x%02x), sys_ind(0x%02x), startCHS(%u,%u,%u), endCHS(%u,%u,%u), startLBA("PFU64"), sizeLBA("PFU64")\n", - leading_comment, p->boot_ind, p->sys_ind, p->cyl, p->head, - p->sector, p->end_cyl, p->end_head, p->end_sector, START_SECT(p), - NR_SECTS(p)); + LOG_EXTRA("%s: boot_ind(0x%02x), sys_ind(0x%02x), startCHS(%u,%u,%u), endCHS(%u,%u,%u), startLBA("PFU64"), sizeLBA("PFU64")\n", + leading_comment, p->boot_ind, p->sys_ind, p->cyl, p->head, + p->sector, p->end_cyl, p->end_head, p->end_sector, + START_SECT(p), NR_SECTS(p)); } #ifdef CONFIG_BSD_DISKLABEL #define BSD_DISKLABEL_PART_TABLE_SECTOR_OFFSET 1 -static void +static inline void print_bsd_partition_info(char *leading_comment, struct bsd_partition *p) { - LOG_EXTRA - ("%s: p_size(%u), p_offset(%u), p_fsize(%u), p_fstype(0x%02X), p_frag(0x%02X), p_cpg(%u)\n", - leading_comment, p->p_size, p->p_offset, p->p_fsize, p->p_fstype, - p->p_frag, p->p_cpg); + LOG_EXTRA("%s: p_size(%u), p_offset(%u), p_fsize(%u), p_fstype(0x%02X), p_frag(0x%02X), p_cpg(%u)\n", + leading_comment, p->p_size, p->p_offset, p->p_fsize, p->p_fstype, p->p_frag, p->p_cpg); } /* @@ -675,9 +672,7 @@ for (p = l->d_partitions; p - l->d_partitions < max_partitions; p++) { if (p->p_fstype != BSD_FS_UNUSED) { - evmsLOG2(EVMS_INFO_EXTRA, - (print_bsd_partition_info - (__FUNCTION__, p))); + print_bsd_partition_info(__FUNCTION__, p); rc = mbr_ebr_process_segment (discover_list, node, (u64) p->p_offset, @@ -903,8 +898,7 @@ dlat->DLA_Array[i].Drive_Letter); partition_name = tmp_buf; } - evmsLOG2(EVMS_INFO_EXTRA, - (print_partition_info(__FUNCTION__, p))); + print_partition_info(__FUNCTION__, p); rc = mbr_ebr_process_segment(discover_list, node, @@ -1102,8 +1096,7 @@ dlat->DLA_Array[i].Drive_Letter); partition_name = tmp_buf; } - evmsLOG2(EVMS_INFO_EXTRA, - (print_partition_info(__FUNCTION__, p))); + print_partition_info(__FUNCTION__, p); rc = mbr_ebr_process_segment(discover_list, node, diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/evms.c linux-2.4.19-evms-1.2.1/drivers/evms/evms.c --- linux-2.4.19-evms-1.2.0/drivers/evms/evms.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/evms.c Wed Dec 18 14:51:48 2002 @@ -28,35 +28,25 @@ * */ -#define DEVICE_NR(device) MINOR(device) /* evms has no partition bits */ -#define DEVICE_NAME "evms" /* name for messaging */ -#define DEVICE_NO_RANDOM /* no entropy to contribute */ -#define DEVICE_OFF(d) /* do nothing */ - //#define LOCAL_DEBUG 1 -#include #include -#include #include #include -#include -#include -#include -#include /* must be included by all block drivers */ -#include +#include #include -#include -#include +#include +#include +#include #include #include -#include #include -#include -#include #include #include #include +#include +#include +#include #include //#define VFS_PATCH_PRESENT @@ -139,7 +129,7 @@ /**********************************************************/ /* START -- arch ioctl32 support */ /**********************************************************/ -#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) +#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64) #include #include @@ -157,11 +147,11 @@ struct evms_sector_io32 { u64 disk_handle; - s32 io_flag; u64 starting_sector; u64 sector_count; - __uvirt_addr buffer_address; + s32 io_flag; s32 status; + __uvirt_addr buffer_address; }; struct evms_rediscover32 { @@ -182,6 +172,7 @@ u32 feature_id; s32 feature_command; s32 status; + u32 data_size; __uvirt_addr feature_ioctl_data; }; @@ -539,19 +530,6 @@ /* START -- exported functions/Common Services */ /**********************************************************/ -/* - * Function: evms_cs_get_version - * Description: This function returns the current EVMS version - */ -void -evms_cs_get_version(int *major, int *minor) -{ - *major = EVMS_MAJOR_VERSION; - *minor = EVMS_MINOR_VERSION; -} - -EXPORT_SYMBOL(evms_cs_get_version); - int evms_cs_check_version(struct evms_version *required, struct evms_version *actual) @@ -586,8 +564,7 @@ evms_cs_deallocate_volume_info(struct evms_logical_node *p) { if (p->iflags & EVMS_FEATURE_BOTTOM) { - evms_cs_remove_item_from_list(&evms_global_feature_node_list, - p); + evms_cs_remove_item_from_list(&evms_global_feature_node_list,p); kfree(p->volume_info); p->volume_info = NULL; p->iflags &= ~EVMS_FEATURE_BOTTOM; @@ -600,8 +577,7 @@ evms_cs_deallocate_logical_node(struct evms_logical_node *p) { if (p->next) { - LOG_SERIOUS - ("Deallocating object whose NEXT ptr is not null!!\n"); + LOG_SERIOUS("Deallocating object whose NEXT ptr is not null!!\n"); } evms_cs_deallocate_volume_info(p); if (p->feature_header) { @@ -627,20 +603,21 @@ ver = &plugin->required_services_version; - LOG_EXTRA - ("registering plugin (plugin.id=%d.%d.%d, plugin.ver=%d.%d.%d, req.svc.ver=%d.%d.%d)\n", - GetPluginOEM(plugin->id), GetPluginType(plugin->id), - GetPluginID(plugin->id), plugin->version.major, - plugin->version.minor, plugin->version.patchlevel, ver->major, - ver->minor, ver->patchlevel); + LOG_EXTRA("registering plugin (plugin.id=%d.%d.%d, " + "plugin.ver=%d.%d.%d, req.svc.ver=%d.%d.%d)\n", + GetPluginOEM(plugin->id), GetPluginType(plugin->id), + GetPluginID(plugin->id), plugin->version.major, + plugin->version.minor, plugin->version.patchlevel, + ver->major, ver->minor, ver->patchlevel); /* check common services requirements */ rc = evms_cs_check_version(ver, &evms_svc_version); if (rc) { - LOG_SERIOUS - ("plugin failed to load: common services (vers:%d,%d,%d) incompatibility!\n", - EVMS_COMMON_SERVICES_MAJOR, EVMS_COMMON_SERVICES_MINOR, - EVMS_COMMON_SERVICES_PATCHLEVEL); + LOG_SERIOUS("plugin failed to load: common services " + "(vers:%d,%d,%d) incompatibility!\n", + EVMS_COMMON_SERVICES_MAJOR, + EVMS_COMMON_SERVICES_MINOR, + EVMS_COMMON_SERVICES_PATCHLEVEL); } if (!rc) { /* ensure a plugin with this feature id is @@ -649,9 +626,8 @@ for (pp = ®istered_plugin_head; *pp; pp = &(*pp)->next) { if ((*pp)->plugin->id == plugin->id) { rc = -EBUSY; - LOG_ERROR - ("error(%d) attempting to load another plugin with id(%x).\n", - rc, plugin->id); + LOG_ERROR("error(%d) attempting to load another " + "plugin with id(%x).\n", rc, plugin->id); } } } @@ -698,7 +674,7 @@ MOD_INC_USE_COUNT; } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_register_plugin); @@ -717,12 +693,12 @@ ver = &plugin->required_services_version; - LOG_EXTRA - ("unregistering plugin (plugin.id=%d.%d.%d, plugin.ver=%d.%d.%d, req.svc.ver=%d.%d.%d)\n", - GetPluginOEM(plugin->id), GetPluginType(plugin->id), - GetPluginID(plugin->id), plugin->version.major, - plugin->version.minor, plugin->version.patchlevel, ver->major, - ver->minor, ver->patchlevel); + LOG_EXTRA("unregistering plugin (plugin.id=%d.%d.%d, " + "plugin.ver=%d.%d.%d, req.svc.ver=%d.%d.%d)\n", + GetPluginOEM(plugin->id), GetPluginType(plugin->id), + GetPluginID(plugin->id), plugin->version.major, + plugin->version.minor, plugin->version.patchlevel, + ver->major, ver->minor, ver->patchlevel); /* ensure a plugin with this feature id is * currently loaded. */ @@ -734,9 +710,8 @@ } if (!found) { rc = -ENOPKG; - LOG_ERROR - ("error(%d) attempt to unload a non-loaded plugin with id(%x).\n", - rc, plugin->id); + LOG_ERROR("error(%d) attempt to unload a non-loaded plugin " + "with id(%x).\n", rc, plugin->id); } /* actually unload the plugin now */ if (!rc) { @@ -753,7 +728,7 @@ /* decrement the usage count */ MOD_DEC_USE_COUNT; } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_unregister_plugin); @@ -789,7 +764,7 @@ if (!rc) *pp = node; - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_add_logical_node_to_list); @@ -816,7 +791,7 @@ rc = 0; break; } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_remove_logical_node_from_list); @@ -836,7 +811,7 @@ set_fs(fs); unlock_kernel(); - return (rc); + return rc; } @@ -860,7 +835,7 @@ if (item_size & (EVMS_VSECTOR_SIZE - 1)) sectors++; - return (sectors); + return sectors; } EXPORT_SYMBOL(evms_cs_size_in_vsectors); @@ -890,7 +865,7 @@ result = -2; } } - return (result); + return result; } EXPORT_SYMBOL(evms_cs_log2); @@ -917,28 +892,16 @@ static u32 crc_table[256]; static u32 crc_table_built = FALSE; -/*********************************************************************/ -/* */ -/* Function Name: build_crc_table */ -/* */ -/* Descriptive Name: This module implements the crc function using */ -/* a table driven method. The required table */ -/* must be setup before the calculate_crc */ -/* function can be used. This table only needs */ -/* to be set up once. This function sets up the */ -/* crc table needed by calculate_crc. */ -/* */ -/* Input: None */ -/* */ -/* Output: None */ -/* */ -/* Error Handling: N/A */ -/* */ -/* Side Effects: The internal crc table is initialized. */ -/* */ -/* Notes: None. */ -/* */ -/*********************************************************************/ +/** + * Function Name: build_crc_table + * + * Description: This module implements the crc function using + * a table driven method. The required table + * must be setup before the calculate_crc + * function can be used. This table only needs + * to be set up once. This function sets up the + * crc table needed by calculate_crc. + **/ static void build_crc_table(void) { @@ -957,33 +920,25 @@ crc_table_built = TRUE; } -/*********************************************************************/ -/* */ -/* Function Name: calculate_crc */ -/* */ -/* Descriptive Name: This function calculates the crc value for */ -/* the data in the buffer specified by Buffer. */ -/* */ -/* Input: u32 crc : This is the starting crc. If you are */ -/* starting a new crc calculation, then */ -/* this should be set to 0xFFFFFFFF. If */ -/* you are continuing a crc calculation */ -/* (i.e. all of the data did not fit in */ -/* the buffer so you could not calculate */ -/* the crc in a single operation), then */ -/* this is the crc output by the last */ -/* calculate_crc call. */ -/* */ -/* Output: The crc for the data in the buffer, based upon the value*/ -/* of the input parameter crc. */ -/* */ -/* Error Handling: None. */ -/* */ -/* Side Effects: None. */ -/* */ -/* Notes: None. */ -/* */ -/*********************************************************************/ +/** + * Function Name: calculate_crc + * + * Description: This function calculates the crc value for + * the data in the buffer specified by Buffer. + * + * Input: u32 crc : This is the starting crc. If you are + * starting a new crc calculation, then + * this should be set to 0xFFFFFFFF. If + * you are continuing a crc calculation + * (i.e. all of the data did not fit in + * the buffer so you could not calculate + * the crc in a single operation), then + * this is the crc output by the last + * calculate_crc call. + * + * Output: The crc for the data in the buffer, based upon the value + * of the input parameter crc. + **/ u32 evms_cs_calculate_crc(u32 crc, void *buffer, u32 buffersize) { @@ -1003,7 +958,7 @@ current_byte++; crc = temp1 ^ temp2; } - return (crc); + return crc; } EXPORT_SYMBOL(evms_cs_calculate_crc); @@ -1033,7 +988,7 @@ /* create the pool management structure */ pool = kmalloc(sizeof (struct evms_pool_mgmt), GFP_KERNEL); if (!pool) { - LOG_CRITICAL("Cannot create %s fpool mgmt structure", + LOG_CRITICAL("Cannot create %s pool mgmt structure", pool_name); return NULL; } @@ -1041,15 +996,18 @@ memset(pool, 0, sizeof (struct evms_pool_mgmt)); pool->member_size = objsize; pool->name = pool_name; - pool->waiters = (atomic_t) ATOMIC_INIT(0); + atomic_set(&pool->waiters, 0); init_waitqueue_head(&pool->wait_queue); /* go create the pool */ pool->cachep = kmem_cache_create(pool->name, pool->member_size, 0, SLAB_HWCACHE_ALIGN, ctor, dtor); - if (!pool->cachep) - panic("Cannot create %s SLAB cache", pool->name); - return (pool); + if (!pool->cachep) { + LOG_CRITICAL("Cannot create %s SLAB cache", pool->name); + kfree(pool); + pool = NULL; + } + return pool; } EXPORT_SYMBOL(evms_cs_create_pool); @@ -1062,7 +1020,7 @@ while (1) { objp = kmem_cache_alloc(pool->cachep, SLAB_NOIO); if (objp || !blockable) { - return (objp); + return objp; } else { /* block and wait for an object to * be returned to the pool @@ -1072,7 +1030,7 @@ (!atomic_read(&pool->waiters))); } } - return (objp); + return objp; } EXPORT_SYMBOL(evms_cs_allocate_from_pool); @@ -1276,7 +1234,7 @@ /* set b_private to aid in quick lookup */ bh->b_private = new_entry; } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_register_for_end_io_notification); @@ -1298,7 +1256,7 @@ break; list_node = &(*list_node)->next; } - return (list_node); + return list_node; } EXPORT_SYMBOL(evms_cs_lookup_item_in_list); @@ -1342,11 +1300,10 @@ } } else { rc = 1; - LOG_DEBUG - ("warning: attempt to add duplicate item(%p) to list(%p).\n", - item, list); + LOG_DEBUG("warning: attempt to add duplicate item(%p) to " + "list(%p).\n", item, list); } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_add_item_to_list); @@ -1380,11 +1337,10 @@ } else { /* no, it was not found */ rc = -1; - LOG_ERROR - ("error(%d): attempt to remove nonexistant node(%p) from list(%p).\n", - rc, item, list); + LOG_ERROR("error(%d): attempt to remove nonexistant node(%p) " + "from list(%p).\n", rc, item, list); } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_remove_item_from_list); @@ -1404,7 +1360,7 @@ int evms_cs_register_device(struct evms_logical_node *device) { - return (evms_cs_add_item_to_list(&evms_global_device_list, device)); + return evms_cs_add_item_to_list(&evms_global_device_list, device); } EXPORT_SYMBOL(evms_cs_register_device); @@ -1422,8 +1378,8 @@ int evms_cs_unregister_device(struct evms_logical_node *device) { - return (evms_cs_remove_item_from_list(&evms_global_device_list, - device)); + return evms_cs_remove_item_from_list(&evms_global_device_list, + device); } EXPORT_SYMBOL(evms_cs_unregister_device); @@ -1456,7 +1412,7 @@ *out_device = (struct evms_logical_node *) find_first_next_list_node->item; - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_find_next_device); @@ -1648,7 +1604,7 @@ evms_proc_dir = create_proc_entry("evms", S_IFDIR, &proc_root); } #endif - return (evms_proc_dir); + return evms_proc_dir; } EXPORT_SYMBOL(evms_cs_get_evms_proc_dir); @@ -1674,7 +1630,7 @@ } else { rc = -ENODEV; } - return (rc); + return rc; } EXPORT_SYMBOL(evms_cs_volume_request_in_progress); @@ -1689,9 +1645,8 @@ (strcmp (evms_logical_volumes[i].node->name, node->name))) { - LOG_DETAILS - ("Invalidating EVMS device %s minor %d\n", - node->name, i); + LOG_DETAILS("Invalidating EVMS device %s minor " + "%d\n", node->name, i); invalidate_device(MKDEV(EVMS_MAJOR, i), 0); break; } @@ -1717,8 +1672,8 @@ #ifdef CONFIG_PROC_FS static int -evms_info_read_proc(char *page, - char **start, off_t off, int count, int *eof, void *data) +evms_info_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) { int sz = 0; char *info_level_text = NULL; @@ -1785,8 +1740,8 @@ } static int -evms_plugins_read_proc(char *page, - char **start, off_t off, int count, int *eof, void *data) +evms_plugins_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) { int sz = 0; struct evms_registered_plugin *rp = NULL; @@ -1833,13 +1788,9 @@ PROCPRINT("%5d %7d %16Ld %s %s %s %s%s\n", EVMS_MAJOR, j, (long long)volume->node->total_vsectors >> 1, - (volume-> - flags & EVMS_VOLUME_FLAG) ? "evms " : - "compat", - (volume-> - flags & EVMS_VOLUME_READ_ONLY) ? "ro" : "rw", - (volume-> - flags & EVMS_VOLUME_PARTIAL) ? "p " : " ", + (volume->flags & EVMS_VOLUME_FLAG) ? "evms " : "compat", + (volume->flags & EVMS_VOLUME_READ_ONLY) ? "ro" : "rw", + (volume->flags & EVMS_VOLUME_PARTIAL) ? "p " : " ", EVMS_DEV_NODE_PATH, volume->name); } } @@ -1879,7 +1830,7 @@ if (copy_to_user(arg, &ver, sizeof (ver))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -1896,7 +1847,7 @@ if (copy_to_user(arg, &ver, sizeof (ver))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -1908,7 +1859,7 @@ if (copy_to_user(arg, &evms_info_level, sizeof (evms_info_level))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -1922,7 +1873,7 @@ else evms_info_level = temp; - return (rc); + return rc; } /* function: evms_quiesce_volume @@ -2006,7 +1957,7 @@ LOG_ERROR("error(%d) %squiescing %s.\n", rc, ((qv->command) ? "" : "un"), volume->name); } - return (rc); + return rc; } /* function: evms_delete_volume @@ -2075,7 +2026,7 @@ LOG_ERROR("error(%d) %s deleting %s.\n", rc, ((dv->command) ? "hard" : "soft"), volume->name); } - return (rc); + return rc; } /* function: evms_user_delete_volume @@ -2162,7 +2113,7 @@ } } } - return (rc); + return rc; } /* function: evms_ioctl_cmd_delete_volume @@ -2206,7 +2157,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } /* function: evms_full_rediscover_prep @@ -2291,8 +2242,7 @@ * NOTE: the delete operation will * clear the bits in the flags field. */ - dv.command = (volume_open) ? - EVMS_SOFT_DELETE : EVMS_HARD_DELETE; + dv.command = volume_open ? EVMS_SOFT_DELETE : EVMS_HARD_DELETE; dv.minor = i; dv.associative_minor = 0; dv.status = 0; @@ -2312,6 +2262,8 @@ ulong array_size = 0; struct evms_logical_volume *volume = NULL; + LOG_DEBUG("Rediscovering volumes...\n"); + rc = tmp.drive_count = 0; user_parms = (struct evms_rediscover_pkt *) arg; /* copy user's parameters to kernel space */ @@ -2389,7 +2341,7 @@ if (copy_to_user(&user_parms->status, &tmp.status, sizeof (tmp.status))) rc = -EFAULT; - return (rc); + return rc; } static struct evms_list_node *user_disk_ptr; @@ -2422,7 +2374,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; } - return (rc); + return rc; } static int @@ -2481,7 +2433,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -2596,7 +2548,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } static int user_minor; @@ -2634,15 +2586,16 @@ * for this volume so it may be * reused. */ - LOG_WARNING - ("ioctl_get_minor: found unmounted %s volume(%u,%u,%s).\n", - ((lv-> - flags & EVMS_VOLUME_SOFT_DELETED) - ? "'soft deleted'" : ""), - EVMS_MAJOR, user_minor, lv->name); - LOG_WARNING - (" releasing minor(%d) used by volume(%s)!\n", - user_minor, lv->name); + LOG_WARNING("ioctl_get_minor: found " + "unmounted %s volume" + "(%u,%u,%s).\n", + (lv->flags & EVMS_VOLUME_SOFT_DELETED) ? + "'soft deleted'" : "", + EVMS_MAJOR, user_minor, + lv->name); + LOG_WARNING(" releasing minor(%d) " + "used by volume(%s)!\n", + user_minor, lv->name); kfree(lv->name); lv->name = NULL; lv->flags = 0; @@ -2659,7 +2612,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; } - return (rc); + return rc; } static int @@ -2691,7 +2644,7 @@ tmp.status = rc; if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } static struct evms_registered_plugin *ioctl_reg_record; @@ -2747,7 +2700,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; } - return (rc); + return rc; } static int @@ -2787,7 +2740,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; } - return (rc); + return rc; } #define MAX_BUFFER_SIZE 65536 @@ -2855,7 +2808,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } #undef MAX_BUFFER_SIZE @@ -2885,7 +2838,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -2920,18 +2873,16 @@ /* registration code */ if (found) { rc = -EBUSY; - LOG_ERROR - ("error(%d) pid(%d) already register to receive signal(%d) on event(%d).\n", - rc, tmp.eventry.pid, tmp.eventry.signo, - tmp.eventry.eventid); + LOG_ERROR("error(%d) pid(%d) already register to " + "receive signal(%d) on event(%d).\n", rc, + tmp.eventry.pid, tmp.eventry.signo, + tmp.eventry.eventid); } else { /* register this pid/event type */ event = kmalloc(sizeof (struct evms_event), GFP_KERNEL); if (!event) { rc = -ENOMEM; - LOG_ERROR - ("error(%d) allocating event structure.\n", - rc); + LOG_ERROR("error(%d) allocating event structure.\n", rc); } else { memset(event, 0, sizeof (struct evms_event)); event->pid = tmp.eventry.pid; @@ -2945,9 +2896,9 @@ /* unregistration code */ if (!found) { rc = -ENODATA; - LOG_ERROR - ("error(%d) attempting to unregister a non-registered pid(%d) on event(%d).\n", - rc, tmp.eventry.pid, tmp.eventry.eventid); + LOG_ERROR("error(%d) attempting to unregister a " + "non-registered pid(%d) on event(%d).\n", + rc, tmp.eventry.pid, tmp.eventry.eventid); } else { event = (*list_node)->item; rc = evms_cs_remove_item_from_list @@ -2962,7 +2913,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -2987,7 +2938,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } static int @@ -3011,7 +2962,7 @@ if (copy_to_user(user_parms, &tmp, sizeof (tmp))) rc = -EFAULT; - return (rc); + return rc; } /************************************************/ @@ -3054,12 +3005,12 @@ if (!rc) { /* get the minor */ minor = MINOR(inode->i_rdev); - LOG_EXTRA - ("ioctl: minor(%lu), dir(%d), size(%d), type(%d), nr(%d)\n", - minor, (cmd >> _IOC_DIRSHIFT) & _IOC_DIRMASK, - (cmd >> _IOC_SIZESHIFT) & _IOC_SIZEMASK, - (cmd >> _IOC_TYPESHIFT) & _IOC_TYPEMASK, - (cmd >> _IOC_NRSHIFT) & _IOC_NRMASK); + LOG_EXTRA("ioctl: minor(%lu), dir(%d), size(%d), type(%d), " + "nr(%d)\n", minor, + (cmd >> _IOC_DIRSHIFT) & _IOC_DIRMASK, + (cmd >> _IOC_SIZESHIFT) & _IOC_SIZEMASK, + (cmd >> _IOC_TYPESHIFT) & _IOC_TYPEMASK, + (cmd >> _IOC_NRSHIFT) & _IOC_NRMASK); /* insure this minor points to a valid volume */ if (minor) { @@ -3255,13 +3206,12 @@ EVMS_CHECK_MEDIA_CHANGE, (unsigned long) NULL); if (rc < 0) { - LOG_ERROR - ("error(%d) doing EVMS_CHECK_MEDIA_CHANGE ioctl on '%s'.\n", - rc, volume->name); + LOG_ERROR("error(%d) doing EVMS_CHECK_MEDIA_CHANGE " + "ioctl on '%s'.\n", rc, volume->name); } } } - return (rc); + return rc; } /************************************************/ @@ -3293,15 +3243,15 @@ rc = evms_cs_remove_logical_node_from_list (&new_device_list, disk); if (rc) { - LOG_ERROR - ("%s: error(%d) removing device(%s) from list.\n", - __FUNCTION__, rc, disk->name); + LOG_ERROR("%s: error(%d) removing device(%s) " + "from list.\n", __FUNCTION__, rc, + disk->name); } rc = evms_cs_add_item_to_list(&disk_list, disk); if (rc) { - LOG_ERROR - ("%s: error(%d) adding device(%s) from list.\n", - __FUNCTION__, rc, disk->name); + LOG_ERROR("%s: error(%d) adding device(%s) " + "from list.\n", __FUNCTION__, rc, + disk->name); } } } @@ -3326,9 +3276,9 @@ EVMS_CHECK_MEDIA_CHANGE, (unsigned long) NULL); if (rc < 0) { - LOG_ERROR - ("%s: error(%d) doing EVMS_CHECK_MEDIA_CHANGE ioctl on '%s'.\n", - __FUNCTION__, rc, disk->name); + LOG_ERROR("%s: error(%d) doing EVMS_CHECK_MEDIA_CHANGE " + "ioctl on '%s'.\n", __FUNCTION__, rc, + disk->name); } else if (rc == 1) { add_to_list = TRUE; } @@ -3340,9 +3290,8 @@ rc = IOCTL(disk, inode, file, EVMS_CHECK_DEVICE_STATUS, (ulong) NULL); if (rc) { - LOG_ERROR - ("error(%d) doing EVMS_CHECK_DEVICE_STATUS ioctl on '%s'.\n", - rc, volume->name); + LOG_ERROR("error(%d) doing EVMS_CHECK_DEVICE_STATUS " + "ioctl on '%s'.\n", rc, volume->name); } if (disk->flags & EVMS_DEVICE_UNAVAILABLE) { add_to_list = TRUE; @@ -3385,9 +3334,8 @@ rc = IOCTL(volume->node, inode, file, EVMS_CHECK_DEVICE_STATUS, (ulong) & status); if (rc) { - LOG_ERROR - ("error(%d) doing EVMS_CHECK_DEVICE_STATUS ioctl on '%s'.\n", - rc, volume->name); + LOG_ERROR("error(%d) doing EVMS_CHECK_DEVICE_STATUS " + "ioctl on '%s'.\n", rc, volume->name); continue; } if (!(status & EVMS_DEVICE_UNAVAILABLE)) { @@ -3428,9 +3376,9 @@ EVMS_GET_DISK_LIST, (unsigned long) &disk_list); if (rc) { - LOG_ERROR - ("%s: error(%d) retrieving underlying disk list for '%s', skipping ...\n", - __FUNCTION__, rc, volume->name); + LOG_ERROR("%s: error(%d) retrieving underlying " + "disk list for '%s', skipping ...\n", + __FUNCTION__, rc, volume->name); continue; } /* quiesce all the changed volumes @@ -3442,10 +3390,9 @@ qv.do_vfs = 0; rc = evms_quiesce_volume(volume, inode, file, &qv); if (rc) { - LOG_ERROR - ("%s: error(%d) attempting to quiesce '%s%s'.\n", - __FUNCTION__, rc, EVMS_DEV_NODE_PATH, - volume->name); + LOG_ERROR("%s: error(%d) attempting to quiesce " + "'%s%s'.\n", __FUNCTION__, rc, + EVMS_DEV_NODE_PATH, volume->name); } } @@ -3476,10 +3423,10 @@ EVMS_REVALIDATE_DISK, (unsigned long) NULL); if (rc) { - LOG_ERROR - ("%s: error(%d) attempting to revalidate '%s%s'.\n", - __FUNCTION__, rc, - EVMS_DEV_NODE_PATH, volume->name); + LOG_ERROR("%s: error(%d) attempting to " + "revalidate '%s%s'.\n", + __FUNCTION__, rc, + EVMS_DEV_NODE_PATH, volume->name); } } } @@ -3511,7 +3458,7 @@ * NOTE: the delete operation will * clear the bits in the flags field. */ - dv.command = is_open(i); + dv.command = (is_open(i)) ? 0 : 1; dv.minor = i; dv.status = 0; rc = evms_delete_volume(volume, &dv); @@ -3564,10 +3511,11 @@ rc = evms_cs_remove_item_from_list(&disk_list, lnode->item); if (rc) { - LOG_ERROR - ("%s: error(%d) attempting to remove item(%p) from disk_list(%p).\n", - __FUNCTION__, rc, lnode->item, - &disk_list); + LOG_ERROR("%s: error(%d) attempting to " + "remove item(%p) from " + "disk_list(%p).\n", + __FUNCTION__, rc, lnode->item, + &disk_list); } } } @@ -3589,9 +3537,8 @@ sizeof (u64), GFP_KERNEL); if (!kernel_rd_pckt.drive_array) { rc = -ENOMEM; - LOG_ERROR - ("%s: error(%d) allocating rediscover drive array.\n", - __FUNCTION__, rc); + LOG_ERROR("%s: error(%d) allocating rediscover " + "drive array.\n", __FUNCTION__, rc); } } /* populate the drive array @@ -3625,7 +3572,7 @@ LOG_DETAILS("%s: rediscover completed.\n", __FUNCTION__); } - return (rc); + return rc; } /************************************************/ @@ -3657,7 +3604,7 @@ EVMS_REVALIDATE_DISK, (unsigned long) NULL); } - return (rc); + return rc; } /************************************************/ @@ -3674,13 +3621,6 @@ int rc = 0, minor = 0; struct evms_logical_volume *volume = NULL; - /* check user access */ - if (!capable(CAP_SYS_ADMIN)) - rc = -EACCES; - if (!rc) { - if (!inode) - rc = -EINVAL; - } rc = evms_check_for_device_changes(inode, file); if (!rc) { /* get the minor */ @@ -3699,13 +3639,12 @@ rc = IOCTL(volume->node, inode, file, EVMS_OPEN_VOLUME, (unsigned long) NULL); if (rc) { - LOG_ERROR - ("error(%d) doing EVMS_OPEN_VOLUME ioctl to '%s'.\n", - rc, volume->name); + LOG_ERROR("error(%d) doing EVMS_OPEN_VOLUME ioctl to " + "'%s'.\n", rc, volume->name); atomic_dec(&volume->opens); } } - return (rc); + return rc; } /************************************************/ @@ -3722,32 +3661,22 @@ int rc = 0, minor = 0; struct evms_logical_volume *volume = NULL; - if (!inode) - rc = -EINVAL; - if (!rc) { - /* get the minor */ - minor = MINOR(inode->i_rdev); - if (minor) { - /* insure this minor points to a valid volume */ - volume = &evms_logical_volumes[minor]; - if (volume->node == NULL) { - rc = -ENXIO; + /* get the minor */ + minor = MINOR(inode->i_rdev); + if (minor) { + /* insure this minor points to a valid volume */ + volume = &evms_logical_volumes[minor]; + if (volume->node) { + rc = IOCTL(volume->node, inode, file, + EVMS_CLOSE_VOLUME, (unsigned long) NULL); + if (rc) { + LOG_ERROR("error(%d) doing EVMS_CLOSE_VOLUME " + "ioctl to '%s'.\n", rc, volume->name); } - } - } - /* go "close" the volume */ - if (!rc && minor) { - rc = IOCTL(volume->node, inode, file, - EVMS_CLOSE_VOLUME, (unsigned long) NULL); - if (rc) { - LOG_ERROR - ("error(%d) doing EVMS_CLOSE_VOLUME ioctl to '%s'.\n", - rc, volume->name); - } else { atomic_dec(&volume->opens); } } - return (rc); + return 0; } /************************************************/ @@ -3773,13 +3702,6 @@ /* START -- RUNTIME support functions */ /**********************************************************/ -static void -evms_do_request_fn(request_queue_t * q) -{ - LOG_WARNING("This function should not be called.\n"); -} - -#ifdef CONFIG_SMP static request_queue_t * evms_find_queue(kdev_t dev) { @@ -3787,11 +3709,9 @@ struct evms_logical_volume *volume; volume = &evms_logical_volumes[MINOR(dev)]; - if (volume->node) - rq = &volume->request_queue; - return (rq); + rq = &volume->request_queue; + return rq; } -#endif /* * Function: evms_make_request_fn @@ -3802,7 +3722,8 @@ { struct evms_logical_volume *volume; - volume = &evms_logical_volumes[MINOR(bh->b_rdev)]; +// volume = &evms_logical_volumes[MINOR(bh->b_rdev)]; + volume = q->queuedata; wait_event(volume->wait_queue, (!volume->quiesced)); if (volume->node) { switch (rw) { @@ -3811,20 +3732,19 @@ atomic_inc(&volume->requests_in_progress); R_IO(volume->node, bh); atomic_dec(&volume->requests_in_progress); - return 0; + break; case WRITE: atomic_inc(&volume->requests_in_progress); W_IO(volume->node, bh); atomic_dec(&volume->requests_in_progress); - return 0; + break; default: - buffer_IO_error(bh); - return 0; + bh->b_end_io(bh, 0); } } else { LOG_ERROR("request for unknown logical volume [minor(%d)].\n", MINOR(bh->b_rdev)); - buffer_IO_error(bh); + bh->b_end_io(bh, 0); } return 0; } @@ -3950,29 +3870,23 @@ int rc, done; struct evms_registered_plugin *p; - LOG_EXTRA("discovering logical partitions...\n"); + LOG_EXTRA("discovering segments...\n"); do { done = TRUE; for (p = registered_plugin_head; p; p = p->next) { if (GetPluginType(p->plugin->id) == EVMS_SEGMENT_MANAGER) { rc = DISCOVER(p, discover_list); - /* RC > 0 means the plugin - * added something to the - * discover list. This also - * means we must loop thru - * these plugins another time. - * RC == 0 means nothing was - * added to the discover list - * by this plugin. - * RC < 0 means the plugin - * encountered some error and + /* RC > 0 means the plugin added something to + * the discover list. This also means we must + * loop thru these plugins another time. + * RC == 0 means nothing was added to the + * discover list by this plugin. RC < 0 means + * the plugin encountered some error and * nothing was added to the list. - * NOTE: If a plugin has both - * added something new to the - * discover list and encountered - * an error, RC > 0 must be - * returned. + * NOTE: If a plugin has both added something + * new to the discover list and encountered an + * error, RC > 0 must be returned. */ if (rc > 0) done = FALSE; @@ -3999,28 +3913,22 @@ int rc, done; struct evms_registered_plugin *p; - LOG_EXTRA("discovering logical volume groups...\n"); + LOG_EXTRA("discovering regions...\n"); do { done = TRUE; for (p = registered_plugin_head; p; p = p->next) { if (GetPluginType(p->plugin->id) == EVMS_REGION_MANAGER) { rc = DISCOVER(p, discover_list); - /* RC > 0 means the plugin - * added something to the - * discover list. This also - * means we must loop thru - * these plugins another time. - * RC == 0 means nothing was - * added to the discover list - * by this plugin. - * RC < 0 means the plugin - * encountered some error and + /* RC > 0 means the plugin added something to + * the discover list. This also means we must + * loop thru these plugins another time. + * RC == 0 means nothing was added to the + * discover list by this plugin. RC < 0 means + * the plugin encountered some error and * nothing was added to the list. - * NOTE: If a plugin has both - * added something new to the - * discover list and encountered - * an error, RC > 0 must be - * returned. + * NOTE: If a plugin has both added something + * new to the discover list and encountered an + * error, RC > 0 must be returned. */ if (rc > 0) done = FALSE; @@ -4053,17 +3961,14 @@ fh->version.patchlevel = le32_to_cpup(&fh->version.patchlevel); fh->engine_version.major = le32_to_cpup(&fh->engine_version.major); fh->engine_version.minor = le32_to_cpup(&fh->engine_version.minor); - fh->engine_version.patchlevel = - le32_to_cpup(&fh->engine_version.patchlevel); + fh->engine_version.patchlevel = le32_to_cpup(&fh->engine_version.patchlevel); fh->flags = le32_to_cpup(&fh->flags); fh->feature_id = le32_to_cpup(&fh->feature_id); fh->sequence_number = le64_to_cpup(&fh->sequence_number); fh->alignment_padding = le64_to_cpup(&fh->alignment_padding); - fh->feature_data1_start_lsn = - le64_to_cpup(&fh->feature_data1_start_lsn); + fh->feature_data1_start_lsn = le64_to_cpup(&fh->feature_data1_start_lsn); fh->feature_data1_size = le64_to_cpup(&fh->feature_data1_size); - fh->feature_data2_start_lsn = - le64_to_cpup(&fh->feature_data2_start_lsn); + fh->feature_data2_start_lsn = le64_to_cpup(&fh->feature_data2_start_lsn); fh->feature_data2_size = le64_to_cpup(&fh->feature_data2_size); fh->volume_serial_number = le64_to_cpup(&fh->volume_serial_number); fh->volume_system_id = le32_to_cpup(&fh->volume_system_id); @@ -4113,10 +4018,10 @@ rc = INIT_IO(node, 0, starting_sector, size_in_sectors, fh); if (rc) { - LOG_ERROR - ("error(%d) probing for %s feature header(at "PFU64") on '%s'.\n", - rc, location_name, starting_sector, - node->name); + LOG_ERROR("error(%d) probing for %s feature " + "header(at "PFU64") on '%s'.\n", rc, + location_name, starting_sector, + node->name); rc_array[i] = rc; continue; } @@ -4136,19 +4041,20 @@ evms_cs_calculate_crc(EVMS_INITIAL_CRC, fh, sizeof (*fh)); if (final_crc != org_crc) { - LOG_ERROR - ("CRC mismatch error [stored(%x), computed(%x)] in %s feature header(at "PFU64") on '%s'.\n", - org_crc, final_crc, location_name, - starting_sector, node->name); + LOG_ERROR("CRC mismatch error [stored(%x), " + "computed(%x)] in %s feature " + "header(at "PFU64") on '%s'.\n", + org_crc, final_crc, location_name, + starting_sector, node->name); rc = -EINVAL; rc_array[i] = rc; continue; } } else { - LOG_WARNING - ("CRC disabled in %s feature header(at "PFU64") on '%s'.\n", - location_name, starting_sector, - node->name); + LOG_WARNING("CRC disabled in %s feature header " + "(at "PFU64") on '%s'.\n", + location_name, starting_sector, + node->name); } /* convert the feature header from the * on-disk format (Little Endian) to @@ -4158,11 +4064,11 @@ /* verify the system data version */ rc = evms_cs_check_version(&version, &fh->version); if (rc) { - LOG_ERROR - ("error: obsolete version(%d,%d,%d) in %s feature header on '%s'.\n", - fh->version.major, fh->version.minor, - fh->version.patchlevel, location_name, - node->name); + LOG_ERROR("error: obsolete version(%d,%d,%d) " + "in %s feature header on '%s'.\n", + fh->version.major, fh->version.minor, + fh->version.patchlevel, location_name, + node->name); rc_array[i] = rc; } } @@ -4180,12 +4086,14 @@ fh2->sequence_number) { fh = fh1; } else { - LOG_WARNING - ("%s feature header sequence number("PFU64") mismatches %s feature header sequence number("PFU64") on '%s'!\n", - evms_primary_string, - fh1->sequence_number, - evms_secondary_string, - fh2->sequence_number, node->name); + LOG_WARNING("%s feature header sequence " + "number("PFU64") mismatches " + "%s feature header sequence " + "number("PFU64") on '%s'!\n", + evms_primary_string, + fh1->sequence_number, + evms_secondary_string, + fh2->sequence_number, node->name); if (fh1->sequence_number > fh2->sequence_number) { fh = fh1; @@ -4225,9 +4133,10 @@ warn_name = evms_primary_string; } /* warn the user about the invalid copy */ - LOG_WARNING - ("warning: error(%d) probing/verifying the %s feature header on '%s'.\n", - rc_array[0] + rc_array[1], warn_name, node->name); + LOG_WARNING("warning: error(%d) probing/verifying the " + "%s feature header on '%s'.\n", + rc_array[0] + rc_array[1], + warn_name, node->name); } else /* both copies had a different error, * and one was a fatal error, so @@ -4251,9 +4160,8 @@ if (!rc) { node->feature_header = fh; if (rc_array[0] != rc_array[1]) { - LOG_DETAILS - ("using %s feature header on '%s'.\n", - location_name, node->name); + LOG_DETAILS("using %s feature header on '%s'.\n", + location_name, node->name); } } @@ -4264,7 +4172,7 @@ node->name); } } - return (rc); + return rc; } static int @@ -4280,10 +4188,7 @@ struct evms_list_node **evms_node; node = tmp_list_head; - rc = evms_cs_remove_logical_node_from_list(&tmp_list_head, - node); - if (rc) - BUG(); + evms_cs_remove_logical_node_from_list(&tmp_list_head, node); /* check for duplicate pointers * search for the node in global list @@ -4311,17 +4216,16 @@ /* check for object flag */ if (node->feature_header->flags & EVMS_VOLUME_DATA_OBJECT) { - LOG_DEFAULT - ("object detected, deleting '%s'.\n", - node->name); + LOG_DEFAULT("object detected, deleting " + "'%s'.\n", node->name); rc = -EINVAL; } else /* check for stop-data flag */ if (node->feature_header->flags & EVMS_VOLUME_DATA_STOP) { - LOG_DEFAULT - ("stop data detected, deleting '%s'.\n", - node->name); + LOG_DEFAULT("stop data detected, " + "deleting '%s'.\n", + node->name); rc = -EINVAL; } else { /* we have a valid feature header. @@ -4376,7 +4280,7 @@ */ evms_cs_add_logical_node_to_list(discover_list, node); } - return (0); + return 0; } /* These define describe the node types that can be isolated. */ @@ -4439,7 +4343,7 @@ break; } } - return (rc); + return rc; } static int @@ -4455,7 +4359,7 @@ break; } } - return (rc); + return rc; } static int @@ -4474,7 +4378,7 @@ if (rc) { LOG_SERIOUS("no plugin loaded for feature id(0x%x)\n", id); } - return (rc); + return rc; } typedef struct evms_volume_build_info_s { @@ -4515,14 +4419,14 @@ &vbi->feature_node_list, volume_node_list, 0, 0); if (rc) - return (rc); + return rc; /* load all the feature headers */ if (!volume_complete) { for (node = *volume_node_list; node; node = node->next) { rc = edef_load_feature_header(node); if (rc) - return (rc); + return rc; } } @@ -4549,7 +4453,7 @@ rc = edef_get_feature_plugin_header(fh->feature_id, &plugin); if (rc) - return (rc); + return rc; /* check for >1 plugins */ if (vbi->plugin != plugin) { vbi->feature_count++; @@ -4566,14 +4470,14 @@ (ISOLATE_EVMS_NODES_BY_FEATURE_AND_DEPTH, volume_node_list, &vbi->feature_node_list, vbi->plugin->id, vbi->max_depth); if (rc) - return (rc); + return rc; if (!vbi->plugin) - return (-ENODATA); + return -ENODATA; if (!vbi->feature_node_list) - return (-ENODATA); + return -ENODATA; } - return (rc); + return rc; } /* function: edef_check_feature_conditions @@ -4590,14 +4494,13 @@ if (vbi->associative_feature_count) { if (vbi->node_count > 1) { rc = -EVMS_VOLUME_FATAL_ERROR; - LOG_ERROR - ("associative ERROR: > 1 nodes(%d) remaining to be processed!\n", - vbi->node_count); + LOG_ERROR("associative ERROR: > 1 nodes(%d) remaining " + "to be processed!\n", vbi->node_count); } else if (vbi->max_depth != 1) { rc = -EVMS_VOLUME_FATAL_ERROR; - LOG_ERROR - ("associative ERROR: associative feature found at node depth("PFU64") != 1!\n", - vbi->max_depth); + LOG_ERROR("associative ERROR: associative feature " + "found at node depth("PFU64") != 1!\n", + vbi->max_depth); } else rc = -EVMS_ASSOCIATIVE_FEATURE; } @@ -4605,19 +4508,19 @@ if (!vbi->max_depth) { if (vbi->node_count > 1) { rc = -EVMS_VOLUME_FATAL_ERROR; - LOG_ERROR - ("max depth ERROR: > 1 nodes(%d) remaining to be processed!\n", - vbi->node_count); + LOG_ERROR("max depth ERROR: > 1 nodes(%d) " + "remaining to be processed!\n", + vbi->node_count); } } else if (vbi->max_depth == 1) { if (vbi->feature_count > 1) { rc = -EVMS_VOLUME_FATAL_ERROR; - LOG_ERROR - ("max depth 1 ERROR: > 1 features remaining to be processed!\n"); + LOG_ERROR("max depth 1 ERROR: > 1 features " + "remaining to be processed!\n"); } } } - return (rc); + return rc; } /* function: edef_apply_features @@ -4664,16 +4567,16 @@ if (top_feature_applying == TRUE) { if (vbi.node_count > 1) { rc = -EVMS_VOLUME_FATAL_ERROR; - LOG_ERROR - ("ERROR: detected > 1 node at volume completion!\n"); + LOG_ERROR("ERROR: detected > 1 node at " + "volume completion!\n"); } done = TRUE; } else { if (!vbi.plugin) { rc = -EVMS_VOLUME_FATAL_ERROR; - LOG_ERROR - ("ERROR: depth("PFU64"): expected another feature!\n", - vbi.max_depth); + LOG_ERROR("ERROR: depth("PFU64"): " + "expected another feature!\n", + vbi.max_depth); done = TRUE; } } @@ -4688,7 +4591,7 @@ &vbi.feature_node_list, volume_node_list, 0, 0)) BUG(); - return (rc); + return rc; } static int @@ -4709,16 +4612,15 @@ rc, node->name); } } else { - LOG_WARNING - ("%s error(%d): node gone, assumed deleted by plugin.\n", - log_text, return_code); + LOG_WARNING("%s error(%d): node gone, assumed deleted by " + "plugin.\n", log_text, return_code); /* plugin must have cleaned up the node. * So just reset the return code and leave. */ rc = 0; } - return (rc); + return rc; } static int @@ -4770,10 +4672,8 @@ default: /* FATAL ERROR */ /* delete each node remaining in the list */ if (volume_node_list) { - LOG_ERROR - ("encountered fatal error building volume '%s'\n", - volume_node_list->volume_info-> - volume_name); + LOG_ERROR("encountered fatal error building volume '%s'\n", + volume_node_list->volume_info->volume_name); } while (volume_node_list) { node = volume_node_list; @@ -4786,7 +4686,7 @@ if (rc) break; } - return (rc); + return rc; } static int @@ -4816,7 +4716,7 @@ edef_delete_node(discover_list, node, rc, "Associative feature"); } - return (rc); + return rc; } static int @@ -4839,7 +4739,7 @@ "Unexpected feature header"); } } - return (rc); + return rc; } /* @@ -4880,7 +4780,7 @@ /* check for incomplete volumes */ rc = edef_check_for_incomplete_volumes(discover_list); - return (rc); + return rc; } /* @@ -4892,19 +4792,19 @@ * and usable to the kernel. * */ -static void +static int eelv_assign_volume_minor(struct evms_logical_node *node, int minor) { struct evms_logical_volume *volume; /* initialize the logical_node entry in the volume array */ volume = &evms_logical_volumes[minor]; - volume->node = node; - volume->name = - kmalloc(strlen(EVMS_GET_NODE_NAME(node)) + 1, GFP_KERNEL); - if (!volume->name) - BUG(); + volume->name = kmalloc(strlen(EVMS_GET_NODE_NAME(node)) + 1, GFP_KERNEL); + if (!volume->name) { + return -ENOMEM; + } strcpy(volume->name, EVMS_GET_NODE_NAME(node)); + volume->node = node; /* copy flags from top level node into volume structure */ volume->flags = node->flags; @@ -4915,8 +4815,8 @@ } /* adjust volume size based on hardsector size */ - node->total_vsectors &= - ~((node->hardsector_size >> EVMS_VSECTOR_SIZE_SHIFT) - 1); + node->total_vsectors &= ~((node->hardsector_size >> + EVMS_VSECTOR_SIZE_SHIFT) - 1); /* initialize the global device arrays */ blksize_size[EVMS_MAJOR][minor] = node->block_size; @@ -4924,17 +4824,17 @@ blk_size[EVMS_MAJOR][minor] = (int) (node->total_vsectors >> 1); /* register this volume with devfs */ - volume->devfs_handle = - devfs_register(evms_dir_devfs_handle, - volume->name, - DEVFS_FL_DEFAULT, - EVMS_MAJOR, minor, - S_IFBLK | S_IRUGO | S_IWUGO, &evms_fops, NULL); + volume->devfs_handle = devfs_register(evms_dir_devfs_handle, + volume->name, DEVFS_FL_DEFAULT, + EVMS_MAJOR, minor, + S_IFBLK|S_IRUGO|S_IWUGO, + &evms_fops, NULL); evms_volumes++; LOG_DEFAULT("Exporting EVMS Volume(%u,%u) from \"%s%s\".\n", EVMS_MAJOR, minor, EVMS_DEV_NODE_PATH, volume->name); + return 0; } /* @@ -4976,10 +4876,10 @@ if (is_dup == TRUE) { evms_cs_remove_logical_node_from_list (discover_list, node); - LOG_DETAILS - ("deleting duplicate %s to EVMS volume(%u,%u,%s)...\n", - type_ptr, EVMS_MAJOR, i, - EVMS_GET_NODE_NAME(node)); + LOG_DETAILS("deleting duplicate %s to " + "EVMS volume(%u,%u,%s)...\n", + type_ptr, EVMS_MAJOR, i, + EVMS_GET_NODE_NAME(node)); /* forget duplicate */ break; } @@ -5002,12 +4902,12 @@ { struct evms_logical_node *next_node, *node; struct evms_logical_volume *lv; - int i, node_removed; + int rc, i, flags; + char *name; for (node = *discover_list; node; node = next_node) { next_node = node->next; - node_removed = FALSE; for (i = 1; i < MAX_EVMS_VOLUMES; i++) { lv = &evms_logical_volumes[i]; /* only check soft deleted volumes: @@ -5016,16 +4916,24 @@ if (lv->flags & EVMS_VOLUME_SOFT_DELETED) { if (!strcmp(EVMS_GET_NODE_NAME(node), lv->name)) { /* reassign requested minor */ - evms_cs_remove_logical_node_from_list - (discover_list, node); - node_removed = TRUE; + evms_cs_remove_logical_node_from_list(discover_list, + node); LOG_DEFAULT("Re"); /* free the previously used name */ - kfree(lv->name); + name = lv->name; lv->name = NULL; /* clear the EVMS_VOLUME_SOFT_DELETED flag */ + flags = lv->flags; lv->flags = 0; - eelv_assign_volume_minor(node, i); + rc = eelv_assign_volume_minor(node, i); + if (rc) { + DELETE(node); + lv->node = NULL; + lv->name = name; + lv->flags = flags; + } else { + kfree(name); + } break; } } @@ -5047,50 +4955,54 @@ eelv_assign_evms_volume_minors(struct evms_logical_node **discover_list) { struct evms_logical_node *next_node, *node, *lv_node; - unsigned int requested_minor, node_removed; + unsigned int requested_minor; + int rc, lv_flags; for (node = *discover_list; node; node = next_node) { next_node = node->next; - node_removed = FALSE; /* only process evms volumes */ - if (node->flags & EVMS_VOLUME_FLAG) { - requested_minor = node->volume_info->volume_minor; - /* is there a requested minor? */ - if (requested_minor) { - int lv_flags = 0; - - /* check range of requested minor */ - if (requested_minor >= MAX_EVMS_VOLUMES) - lv_node = node; - else { - struct evms_logical_volume *lv; - lv = &evms_logical_volumes - [requested_minor]; - lv_node = lv->node; - lv_flags = lv->flags; - } - if ((!lv_node) - && (!(lv_flags & EVMS_VOLUME_SOFT_DELETED))) { - /* assign requested minor */ - evms_cs_remove_logical_node_from_list - (discover_list, node); - node_removed = TRUE; - eelv_assign_volume_minor(node, - requested_minor); - } else { - LOG_WARNING - ("EVMS volume(%s) requesting invalid/in-use minor(%d), assigning next available!\n", - node->volume_info->volume_name, - requested_minor); - /* - * requested minor is already - * in use, defer assignment - * until later. - */ - node->volume_info->volume_minor = 0; - } + if (!(node->flags & EVMS_VOLUME_FLAG)) { + continue; + } + + /* is there a requested minor? */ + requested_minor = node->volume_info->volume_minor; + if (!requested_minor) { + continue; + } + + lv_flags = 0; + lv_node = NULL; + + /* check range of requested minor */ + if (requested_minor >= MAX_EVMS_VOLUMES) { + lv_node = node; + } else { + struct evms_logical_volume *lv; + lv = &evms_logical_volumes[requested_minor]; + lv_node = lv->node; + lv_flags = lv->flags; + } + + if (!lv_node && !(lv_flags & EVMS_VOLUME_SOFT_DELETED)) { + /* assign requested minor */ + evms_cs_remove_logical_node_from_list(discover_list, + node); + rc = eelv_assign_volume_minor(node, requested_minor); + if (rc) { + DELETE(node); } + } else { + LOG_WARNING("EVMS volume(%s) requesting invalid/in-use " + "minor(%d), assigning next available!\n", + node->volume_info->volume_name, + requested_minor); + /* requested minor is already + * in use, defer assignment + * until later. + */ + node->volume_info->volume_minor = 0; } } } @@ -5112,12 +5024,11 @@ **discover_list) { struct evms_logical_node *next_node, *node; - int requested_minor, node_removed; + int requested_minor, rc; for (node = *discover_list; node; node = next_node) { next_node = node->next; - node_removed = FALSE; /* only process evms volumes */ /* all remaining evms volumes should now * have a minor value of 0, meaning they @@ -5128,20 +5039,24 @@ if (node->flags & EVMS_VOLUME_FLAG) { evms_cs_remove_logical_node_from_list(discover_list, node); - node_removed = TRUE; /* find next available minor number */ for (requested_minor = 255; + requested_minor > 0 && (evms_logical_volumes[requested_minor].node || - evms_logical_volumes[requested_minor].name) && - requested_minor; requested_minor--) ; + evms_logical_volumes[requested_minor].name); + requested_minor--) ; /* check range of assigned minor */ if (!requested_minor) { - LOG_CRITICAL - ("no more minor numbers available for evms volumes!!!!\n"); + LOG_CRITICAL("no more minor numbers available " + "for evms volumes!!!!\n"); DELETE(node); - } else + } else { /* assign requested minor */ - eelv_assign_volume_minor(node, requested_minor); + rc = eelv_assign_volume_minor(node, requested_minor); + if (rc) { + DELETE(node); + } + } } } } @@ -5159,7 +5074,7 @@ eelv_assign_remaining_volume_minors(struct evms_logical_node **discover_list) { struct evms_logical_node *node; - int minor; + int minor, rc; while (*discover_list) { node = *discover_list; @@ -5167,17 +5082,22 @@ /* find next available minor number */ for (minor = 1; + minor < MAX_EVMS_VOLUMES && (evms_logical_volumes[minor].node || - evms_logical_volumes[minor].name) && - minor < MAX_EVMS_VOLUMES; minor++) ; + evms_logical_volumes[minor].name); + minor++) ; if (minor >= MAX_EVMS_VOLUMES) { - LOG_CRITICAL - ("no more minor numbers available for compatibility volumes!!!!\n"); + LOG_CRITICAL("no more minor numbers available for " + "compatibility volumes!!!!\n"); DELETE(node); - } else + } else { /* assign minor */ - eelv_assign_volume_minor(node, minor); + rc = eelv_assign_volume_minor(node, minor); + if (rc) { + DELETE(node); + } + } } } @@ -5203,18 +5123,16 @@ if (lv->flags & EVMS_VOLUME_SOFT_DELETED) { if (is_open(i)) lv->flags |= EVMS_VOLUME_CORRUPT; - LOG_ERROR - ("error: rediscovery failed to find %smounted 'soft deleted' volume(%u,%u,%s)...\n", - ((lv->flags & EVMS_VOLUME_CORRUPT) ? "" : "un"), - EVMS_MAJOR, i, lv->name); + LOG_ERROR("error: rediscovery failed to find %smounted " + "'soft deleted' volume(%u,%u,%s)...\n", + ((lv->flags & EVMS_VOLUME_CORRUPT) ? "" : "un"), + EVMS_MAJOR, i, lv->name); if (lv->flags & EVMS_VOLUME_CORRUPT) { - LOG_ERROR - (" flagging volume(%u,%u,%s) as CORRUPT!\n", - EVMS_MAJOR, i, lv->name); + LOG_ERROR(" flagging volume(%u,%u,%s) as " + "CORRUPT!\n", EVMS_MAJOR, i, lv->name); } else { - LOG_ERROR - (" releasing minor(%d) used by volume(%s)!\n", - i, lv->name); + LOG_ERROR(" releasing minor(%d) used by " + "volume(%s)!\n", i, lv->name); /* clear logical volume structure * for this volume so it may be * reused. @@ -5318,12 +5236,20 @@ (discover_parms->drive_count == REDISCOVER_ALL_DEVICES)) use_all_disks = TRUE; + if (!use_all_disks) { + LOG_DEBUG("discovering %d disks:\n", discover_parms->drive_count); + for (i = 0; i < discover_parms->drive_count; i++) { + disk_node = DEV_HANDLE_TO_NODE(discover_parms->drive_array[i]); + LOG_DEBUG(" disk %d: %s\n", i, disk_node->name); + } + } + /* copy the disk nodes specified in the */ /* discover_parms over to a discover list */ src_node = src_list; while (src_node) { move_node = use_all_disks; - if (move_node == FALSE) + if (move_node == FALSE) { /* check the rediscovery array */ for (i = 0; i < discover_parms->drive_count; i++) { disk_node = @@ -5334,6 +5260,7 @@ break; } } + } /* check to see if we want this node */ if (move_node == TRUE) evms_cs_add_logical_node_to_list(trg_list, @@ -5343,7 +5270,7 @@ /* advance to next struct evms_list_node */ src_node = src_node->next; } - return (rc); + return rc; } static int @@ -5386,7 +5313,7 @@ evms_export_logical_volumes(&discover_list); evms_cs_signal_event(EVMS_EVENT_END_OF_DISCOVERY); } - return (rc); + return rc; } /* function: evms_notify_reboot @@ -5417,7 +5344,7 @@ if (!volume->node) continue; qv.command = 1; // quiesce - qv.minor = i; // + qv.minor = i; qv.status = 0; // reset status qv.do_vfs = 0; evms_quiesce_volume(volume, &inode, NULL, &qv); @@ -5444,7 +5371,7 @@ * is mounted, and 'hard' delete * if it is not. */ - dv.command = is_open(i); + dv.command = (is_open(i)) ? 0 : 1; dv.minor = i; dv.status = 0; evms_delete_volume(volume, &dv); @@ -5532,197 +5459,178 @@ static int __init evms_init_module(void) { - int rc = 0, i; + int rc = -ENOMEM, i; int *evms_blocksizes; LOG_DEFAULT("EVMS v%d.%d.%d initializing .... info level(%d).\n", - EVMS_MAJOR_VERSION, - EVMS_MINOR_VERSION, + EVMS_MAJOR_VERSION, EVMS_MINOR_VERSION, EVMS_PATCHLEVEL_VERSION, evms_info_level); - /* initialize memory management counters */ - evms_allocs = (atomic_t) ATOMIC_INIT(0); - evms_logical_nodes = (atomic_t) ATOMIC_INIT(0); - - /* initialize the io_notify_entry pool */ - if (!rc) - evms_io_notify_pool = evms_cs_create_pool(sizeof (io_notify_t), - "EVMS IO Notify", - io_notify_cache_ctor, - NULL); - - /* initialize the "public" buffer_head pool */ - if (!rc) - evms_bh_pool = evms_cs_create_pool(sizeof (struct buffer_head), - "EVMS BH", - bh_cache_ctor, NULL); - - /* allocate the logical volume array */ - if (!rc) - evms_logical_volumes = - kmalloc(sizeof (struct evms_logical_volume) * - MAX_EVMS_VOLUMES, GFP_KERNEL); + /* Initialize memory management counters */ + atomic_set(&evms_allocs, 0); + atomic_set(&evms_logical_nodes, 0); + + /* Initialize the io_notify_entry pool */ + evms_io_notify_pool = evms_cs_create_pool(sizeof (io_notify_t), + "EVMS IO Notify", + io_notify_cache_ctor, NULL); + if (!evms_io_notify_pool) { + LOG_CRITICAL("can't allocate memory for I/O Notify pool.\n"); + goto error; + } + + /* Initialize the "public" buffer_head pool */ + evms_bh_pool = evms_cs_create_pool(sizeof (struct buffer_head), + "EVMS BH", bh_cache_ctor, NULL); + if (!evms_bh_pool) { + LOG_CRITICAL("can't allocate memory for BH pool.\n"); + goto error; + } + + /* Allocate the EVMS blk_size array */ + evms_blocksizes = kmalloc(MAX_EVMS_VOLUMES * sizeof (int), GFP_KERNEL); + if (!evms_blocksizes) { + LOG_CRITICAL("can't allocate memory for blk_size array.\n"); + goto error; + } + memset(evms_blocksizes, 0, MAX_EVMS_VOLUMES * sizeof (int)); + blk_size[EVMS_MAJOR] = evms_blocksizes; + + /* Allocate the EVMS blksize_size array */ + evms_blocksizes = kmalloc(MAX_EVMS_VOLUMES * sizeof (int), GFP_KERNEL); + if (!evms_blocksizes) { + LOG_CRITICAL("can't allocate memory for blksize_size array.\n"); + goto error; + } + memset(evms_blocksizes, 0, MAX_EVMS_VOLUMES * sizeof (int)); + blksize_size[EVMS_MAJOR] = evms_blocksizes; + + /* Allocate the EVMS hardsect_size array */ + evms_blocksizes = kmalloc(MAX_EVMS_VOLUMES * sizeof (int), GFP_KERNEL); + if (!evms_blocksizes) { + LOG_CRITICAL("can't allocate memory for hardsect_size array.\n"); + goto error; + } + memset(evms_blocksizes, 0, MAX_EVMS_VOLUMES * sizeof (int)); + hardsect_size[EVMS_MAJOR] = evms_blocksizes; + + + /* Allocate the logical volume array */ + evms_logical_volumes = kmalloc(sizeof (struct evms_logical_volume) * + MAX_EVMS_VOLUMES, GFP_KERNEL); if (!evms_logical_volumes) { - rc = -ENOMEM; + LOG_CRITICAL("can't allocate memory for logical volume array.\n"); + goto error; } /* initialize the logical volume array entries */ - if (!rc) { - memset(evms_logical_volumes, 0, - sizeof (struct evms_logical_volume) * MAX_EVMS_VOLUMES); - for (i = 1; i < MAX_EVMS_VOLUMES; i++) { - struct evms_logical_volume *volume; - - volume = &evms_logical_volumes[i]; - init_waitqueue_head(&volume->wait_queue); - volume->requests_in_progress = - (atomic_t) ATOMIC_INIT(0); -#ifdef CONFIG_SMP - blk_init_queue(&volume->request_queue, - evms_do_request_fn); - blk_queue_make_request(&volume->request_queue, - evms_make_request_fn); -#endif - } - } - - /* allocate EVMS' blk_size array */ - if (!rc) { - evms_blocksizes = kmalloc(MAX_EVMS_VOLUMES * - sizeof (int), GFP_KERNEL); - if (!evms_blocksizes) { - rc = -ENOMEM; - LOG_CRITICAL - ("can't allocate memory for EVMS blk_size\n"); - } else { - memset(evms_blocksizes, 0, - MAX_EVMS_VOLUMES * sizeof (int)); - blk_size[EVMS_MAJOR] = evms_blocksizes; - } + memset(evms_logical_volumes, 0, + sizeof (struct evms_logical_volume) * MAX_EVMS_VOLUMES); + for (i = 1; i < MAX_EVMS_VOLUMES; i++) { + struct evms_logical_volume *volume = &evms_logical_volumes[i]; + atomic_set(&volume->opens, 0); + atomic_set(&volume->requests_in_progress, 0); + init_waitqueue_head(&volume->wait_queue); + blk_queue_make_request(&volume->request_queue, evms_make_request_fn); + volume->request_queue.queuedata = volume; } - /* allocate EVMS' blksize_size array */ - if (!rc) { - evms_blocksizes = kmalloc(MAX_EVMS_VOLUMES * - sizeof (int), GFP_KERNEL); - if (!evms_blocksizes) { - rc = -ENOMEM; - LOG_CRITICAL - ("can't allocate memory for EVMS blksize_size\n"); - } else { - memset(evms_blocksizes, 0, - MAX_EVMS_VOLUMES * sizeof (int)); - blksize_size[EVMS_MAJOR] = evms_blocksizes; - } - } - - /* allocate EVMS' hardsect_size array */ - if (!rc) { - evms_blocksizes = kmalloc(MAX_EVMS_VOLUMES * - sizeof (int), GFP_KERNEL); - if (!evms_blocksizes) { - rc = -ENOMEM; - LOG_CRITICAL - ("can't allocate memory for EVMS hardsect_size\n"); - } else { - memset(evms_blocksizes, 0, - MAX_EVMS_VOLUMES * sizeof (int)); - hardsect_size[EVMS_MAJOR] = evms_blocksizes; - } - } /* Register the block device */ - if (!rc) { - rc = devfs_register_blkdev(EVMS_MAJOR, EVMS_DIR_NAME, - &evms_fops); - if (rc) { - LOG_CRITICAL - ("error calling devfs_register_blkdev() err=%u\n", - rc); - rc = -EINVAL; - } + rc = devfs_register_blkdev(EVMS_MAJOR, EVMS_DIR_NAME, &evms_fops); + if (rc) { + LOG_CRITICAL("error(%d) calling devfs_register_blkdev().\n", rc); + goto error; } - /* Register with devfs */ - if (!rc) { - evms_dir_devfs_handle = devfs_mk_dir(NULL, EVMS_DIR_NAME, NULL); - // A NULL return cannot be fatal. - // Devfs just might not be running - if (!evms_dir_devfs_handle) { - LOG_EXTRA - ("NULL return from devfs_mk_dir() for \"%s\"\n", - EVMS_DIR_NAME); - LOG_EXTRA("Is devfs enabled?\n"); - } else { - evms_blk_devfs_handle = - devfs_register(evms_dir_devfs_handle, EVMS_DEV_NAME, - DEVFS_FL_DEFAULT, EVMS_MAJOR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, - &evms_fops, NULL); - if (!evms_blk_devfs_handle) { - LOG_DETAILS - ("NULL return from devfs_register() for \"%s\"\n", - EVMS_DEV_NAME); - } + /* Register with devfs. A NULL return is not fatal. */ + evms_dir_devfs_handle = devfs_mk_dir(NULL, EVMS_DIR_NAME, NULL); + if (evms_dir_devfs_handle) { + evms_blk_devfs_handle = devfs_register(evms_dir_devfs_handle, + EVMS_DEV_NAME, DEVFS_FL_DEFAULT, + EVMS_MAJOR, 0, + S_IFBLK|S_IRUGO|S_IWUGO, + &evms_fops, NULL); + if (!evms_blk_devfs_handle) { + LOG_DETAILS("NULL return from devfs_register() for \"%s\"\n", + EVMS_DEV_NAME); } } - if (!rc) { - read_ahead[EVMS_MAJOR] = 4096; -#ifdef CONFIG_SMP - blk_dev[EVMS_MAJOR].queue = evms_find_queue; -#else - blk_init_queue(BLK_DEFAULT_QUEUE(EVMS_MAJOR), - evms_do_request_fn); - blk_queue_make_request(BLK_DEFAULT_QUEUE(EVMS_MAJOR), - evms_make_request_fn); -#endif + read_ahead[EVMS_MAJOR] = 4096; + blk_dev[EVMS_MAJOR].queue = evms_find_queue; + blk_queue_make_request(BLK_DEFAULT_QUEUE(EVMS_MAJOR), evms_make_request_fn); + #ifdef CONFIG_PROC_FS - evms_cs_get_evms_proc_dir(); - if (evms_proc_dir) { - create_proc_read_entry("info", 0, evms_proc_dir, - evms_info_read_proc, NULL); - create_proc_read_entry("plugins", 0, evms_proc_dir, - evms_plugins_read_proc, NULL); - create_proc_read_entry("volumes", 0, evms_proc_dir, - evms_volumes_read_proc, NULL); - } - evms_table_header = register_sysctl_table(dev_dir_table, 1); + evms_cs_get_evms_proc_dir(); + if (evms_proc_dir) { + create_proc_read_entry("info", 0, evms_proc_dir, + evms_info_read_proc, NULL); + create_proc_read_entry("plugins", 0, evms_proc_dir, + evms_plugins_read_proc, NULL); + create_proc_read_entry("volumes", 0, evms_proc_dir, + evms_volumes_read_proc, NULL); + } + evms_table_header = register_sysctl_table(dev_dir_table, 1); #endif - /* Register for reboot notification */ - register_reboot_notifier(&evms_notifier); -#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) - /* Register evms 32bit ioctl handlers */ - lock_kernel(); - register_ioctl32_conversion(EVMS_GET_INFO_LEVEL,NULL); - register_ioctl32_conversion(EVMS_SET_INFO_LEVEL,NULL); - register_ioctl32_conversion(EVMS_REDISCOVER_VOLUMES_32, - evms_rediscover); - register_ioctl32_conversion(EVMS_DELETE_VOLUME,NULL); - register_ioctl32_conversion(EVMS_PLUGIN_IOCTL_32, - evms_plugin_ioctl); - register_ioctl32_conversion(EVMS_PROCESS_NOTIFY_EVENT,NULL); - register_ioctl32_conversion(EVMS_GET_LOGICAL_DISK,NULL); - register_ioctl32_conversion(EVMS_GET_LOGICAL_DISK_INFO,NULL); - register_ioctl32_conversion(EVMS_SECTOR_IO_32, evms_sector_io); - register_ioctl32_conversion(EVMS_GET_MINOR,NULL); - register_ioctl32_conversion(EVMS_GET_VOLUME_DATA,NULL); - register_ioctl32_conversion(EVMS_GET_PLUGIN,NULL); - register_ioctl32_conversion(EVMS_COMPUTE_CSUM_32, - evms_compute_csum); - register_ioctl32_conversion(EVMS_GET_BMAP,NULL); - register_ioctl32_conversion(EVMS_GET_IOCTL_VERSION,NULL); - register_ioctl32_conversion(EVMS_GET_VERSION,NULL); - register_ioctl32_conversion(EVMS_UPDATE_DEVICE_INFO,NULL); - register_ioctl32_conversion(EVMS_CHECK_MOUNT_STATUS,NULL); - register_ioctl32_conversion(EVMS_GET_VOL_STRIPE_INFO,NULL); - unlock_kernel(); -#endif + /* Register for reboot notification */ + register_reboot_notifier(&evms_notifier); - } +#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64) + /* Register evms 32bit ioctl handlers. UGLY!!! */ + lock_kernel(); + register_ioctl32_conversion(EVMS_GET_IOCTL_VERSION,NULL); + register_ioctl32_conversion(EVMS_GET_VERSION,NULL); + register_ioctl32_conversion(EVMS_GET_INFO_LEVEL,NULL); + register_ioctl32_conversion(EVMS_SET_INFO_LEVEL,NULL); + register_ioctl32_conversion(EVMS_REDISCOVER_VOLUMES_32, evms_rediscover); + register_ioctl32_conversion(EVMS_DELETE_VOLUME,NULL); + register_ioctl32_conversion(EVMS_PLUGIN_IOCTL_32, evms_plugin_ioctl); + register_ioctl32_conversion(EVMS_PROCESS_NOTIFY_EVENT,NULL); + register_ioctl32_conversion(EVMS_GET_LOGICAL_DISK,NULL); + register_ioctl32_conversion(EVMS_GET_LOGICAL_DISK_INFO,NULL); + register_ioctl32_conversion(EVMS_SECTOR_IO_32, evms_sector_io); + register_ioctl32_conversion(EVMS_GET_MINOR,NULL); + register_ioctl32_conversion(EVMS_GET_VOLUME_DATA,NULL); + register_ioctl32_conversion(EVMS_GET_PLUGIN,NULL); + register_ioctl32_conversion(EVMS_COMPUTE_CSUM_32, evms_compute_csum); + register_ioctl32_conversion(EVMS_GET_BMAP,NULL); + register_ioctl32_conversion(EVMS_CHECK_MOUNT_STATUS,NULL); + register_ioctl32_conversion(EVMS_CHECK_OPEN_STATUS,NULL); + register_ioctl32_conversion(EVMS_GET_VOL_STRIPE_INFO,NULL); + unlock_kernel(); +#endif +done: return rc; + +error: + if (evms_logical_volumes) { + kfree(evms_logical_volumes); + evms_logical_volumes = NULL; + } + if (hardsect_size[EVMS_MAJOR]) { + kfree(hardsect_size[EVMS_MAJOR]); + hardsect_size[EVMS_MAJOR] = NULL; + } + if (blksize_size[EVMS_MAJOR]) { + kfree(blksize_size[EVMS_MAJOR]); + blksize_size[EVMS_MAJOR] = NULL; + } + if (blk_size[EVMS_MAJOR]) { + kfree(blk_size[EVMS_MAJOR]); + blk_size[EVMS_MAJOR] = NULL; + } + if (evms_bh_pool) { + evms_cs_destroy_pool(evms_bh_pool); + evms_bh_pool = NULL; + } + if (evms_io_notify_pool) { + evms_cs_destroy_pool(evms_io_notify_pool); + evms_io_notify_pool = NULL; + } + goto done; } /* @@ -5732,13 +5640,14 @@ static void __exit evms_exit_module(void) { - LOG_DEFAULT("EVMS v%d.%d.%d unloading ....\n", - EVMS_MAJOR_VERSION, + LOG_DEFAULT("EVMS v%d.%d.%d unloading ....\n", EVMS_MAJOR_VERSION, EVMS_MINOR_VERSION, EVMS_PATCHLEVEL_VERSION); -#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) - /* Un-Register evms 32bit ioctl handlers */ +#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64) + /* Unregister evms 32bit ioctl handlers */ lock_kernel(); + unregister_ioctl32_conversion(EVMS_GET_IOCTL_VERSION); + unregister_ioctl32_conversion(EVMS_GET_VERSION); unregister_ioctl32_conversion(EVMS_GET_INFO_LEVEL); unregister_ioctl32_conversion(EVMS_SET_INFO_LEVEL); unregister_ioctl32_conversion(EVMS_REDISCOVER_VOLUMES_32); @@ -5753,50 +5662,51 @@ unregister_ioctl32_conversion(EVMS_GET_PLUGIN); unregister_ioctl32_conversion(EVMS_COMPUTE_CSUM_32); unregister_ioctl32_conversion(EVMS_GET_BMAP); - unregister_ioctl32_conversion(EVMS_GET_IOCTL_VERSION); - unregister_ioctl32_conversion(EVMS_GET_VERSION); - unregister_ioctl32_conversion(EVMS_UPDATE_DEVICE_INFO); unregister_ioctl32_conversion(EVMS_CHECK_MOUNT_STATUS); + unregister_ioctl32_conversion(EVMS_CHECK_OPEN_STATUS); unregister_ioctl32_conversion(EVMS_GET_VOL_STRIPE_INFO); unlock_kernel(); #endif - /* unregister with devfs - */ + unregister_reboot_notifier(&evms_notifier); + +#ifdef CONFIG_PROC_FS + unregister_sysctl_table(evms_table_header); + if (evms_proc_dir) { + remove_proc_entry("volumes", evms_proc_dir); + remove_proc_entry("plugins", evms_proc_dir); + remove_proc_entry("info", evms_proc_dir); + remove_proc_entry("evms", NULL); + } +#endif + + /* Clean up the default queue. */ + blk_dev[EVMS_MAJOR].queue = NULL; + blk_queue_make_request(BLK_DEFAULT_QUEUE(EVMS_MAJOR), NULL); + + /* Unregister with devfs */ devfs_unregister(evms_dir_devfs_handle); - /* clean up the queue for the block device - */ - blk_cleanup_queue(blk_get_queue(MKDEV(EVMS_MAJOR, 0))); - /* unregister block device - */ + + /* Unregister the block device */ devfs_unregister_blkdev(EVMS_MAJOR, EVMS_DIR_NAME); - /* deallocate device arrays - */ + + /* Deallocate logical volumes array */ + kfree(evms_logical_volumes); + + /* Deallocate device arrays */ kfree(blk_size[EVMS_MAJOR]); - blk_size[EVMS_MAJOR] = NULL; kfree(blksize_size[EVMS_MAJOR]); - blksize_size[EVMS_MAJOR] = NULL; kfree(hardsect_size[EVMS_MAJOR]); + blk_size[EVMS_MAJOR] = NULL; + blksize_size[EVMS_MAJOR] = NULL; hardsect_size[EVMS_MAJOR] = NULL; read_ahead[EVMS_MAJOR] = 0; - /* deallocate logical volumes array - */ - kfree(evms_logical_volumes); - /* destroy buffer head pool - */ + + /* Destroy buffer head pool */ evms_cs_destroy_pool(evms_bh_pool); - /* destroy io notify pool - */ + + /* Destroy io notify pool */ evms_cs_destroy_pool(evms_io_notify_pool); -#ifdef CONFIG_PROC_FS - if (evms_proc_dir) { - remove_proc_entry("volumes", evms_proc_dir); - remove_proc_entry("plugins", evms_proc_dir); - remove_proc_entry("info", evms_proc_dir); - remove_proc_entry("evms", NULL); - } - unregister_sysctl_table(evms_table_header); -#endif } /* @@ -5818,30 +5728,6 @@ return 0; } -/* - * a placeholder for cluster enablement - */ -void -evms_cluster_init(int nodeid, int clusterid) -{ - /* dummy */ - return; -} - -EXPORT_SYMBOL(evms_cluster_init); - -/* - * a placeholder for cluster enablement - */ -int -evms_cluster_shutdown(void) -{ - /* dummy */ - return -1; -} - -EXPORT_SYMBOL(evms_cluster_shutdown); - static int __init evms_boot_info_level(char *str) { @@ -5860,6 +5746,3 @@ MODULE_LICENSE("GPL"); #endif -/**********************************************************/ -/* END -- INIT/DISCOVERY support functions */ -/**********************************************************/ diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/evms_bbr.c linux-2.4.19-evms-1.2.1/drivers/evms/evms_bbr.c --- linux-2.4.19-evms-1.2.0/drivers/evms/evms_bbr.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/evms_bbr.c Wed Dec 18 14:51:48 2002 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -42,24 +43,15 @@ static int bbr_delete(struct evms_logical_node * node); static void bbr_read(struct evms_logical_node * node, struct buffer_head * bh); static void bbr_write(struct evms_logical_node * node, struct buffer_head * bh); -static int bbr_ioctl(struct evms_logical_node * bbr_node, - struct inode * inode, - struct file * file, - unsigned int cmd, - unsigned long arg); -static int bbr_direct_ioctl(struct inode * inode, - struct file * file, - unsigned int cmd, - unsigned long arg); -static int bbr_init_io(struct evms_logical_node * bbr_node, - int io_flag, - u64 startLSN, - u64 nr_sects, - void * bufptr); +static int bbr_ioctl(struct evms_logical_node * bbr_node, struct inode * inode, + struct file * file, unsigned int cmd, unsigned long arg); +static int bbr_direct_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, unsigned long arg); +static int bbr_init_io(struct evms_logical_node * bbr_node, int io_flag, + u64 startLSN, u64 nr_sects, void * bufptr); /* Other function prototypes. */ static int bbr_create_pools(void); -static void bbr_destroy_pools(void); static u32 bbr_table_to_remap_list(struct bbr_private * bbr_id); static void bbr_io_handler(void * void_data); static void bbr_free_private(struct bbr_private * bbr_id); @@ -71,11 +63,13 @@ /* Data pertaining to the I/O thread. */ static struct evms_thread * bbr_io_thread = NULL; static spinlock_t bbr_io_list_lock = SPIN_LOCK_UNLOCKED; -static struct list_head bbr_io_list = LIST_HEAD_INIT(bbr_io_list); +static LIST_HEAD(bbr_io_list); /* Global pools for bbr_io_buf's and bbr_remap's. */ kmem_cache_t * bbr_io_buf_slab; mempool_t * bbr_io_buf_pool; +kmem_cache_t * bbr_bh_slab; +mempool_t * bbr_bh_pool; kmem_cache_t * bbr_remap_slab; mempool_t * bbr_remap_pool; @@ -585,7 +579,7 @@ (*ID)->nr_replacement_blks = nr_sects * EVMS_BBR_ENTRIES_PER_SECT; (*ID)->start_replacement_sect = md1->start_replacement_sect; - (*ID)->in_use_replacement_blks = (atomic_t)ATOMIC_INIT(0); + atomic_set(&(*ID)->in_use_replacement_blks, 0); (*ID)->bbr_id_lock = SPIN_LOCK_UNLOCKED; if ( !bbr_remap_pool || !bbr_io_buf_pool ) { rc = bbr_create_pools(); @@ -860,49 +854,6 @@ kmem_cache_free(data, ptr); } -static int bbr_create_pools(void) -{ - /* Create a memory pool for the remap list. */ - if (!bbr_remap_slab) { - bbr_remap_slab = kmem_cache_create("BBR_Remap_Slab", - sizeof(struct bbr_runtime_remap), - 0, SLAB_HWCACHE_ALIGN, - NULL, NULL); - if (!bbr_remap_slab) { - panic("Unable to create BBR remap cache."); - } - } - if (!bbr_remap_pool) { - bbr_remap_pool = mempool_create(64, bbr_slab_pool_alloc, - bbr_slab_pool_free, - bbr_remap_slab); - if (!bbr_remap_pool) { - panic("Unable to create BBR remap pool."); - } - } - - /* Create a memory pool for the BBR I/O anchors. */ - if (!bbr_io_buf_slab) { - bbr_io_buf_slab = kmem_cache_create("BBR_IO_Buf_Slab", - sizeof(struct bbr_io_buffer), - 0, SLAB_HWCACHE_ALIGN, - NULL, NULL); - if (!bbr_io_buf_slab) { - panic("Unable to create BBR I/O buffer cache."); - } - } - if (!bbr_io_buf_pool) { - bbr_io_buf_pool = mempool_create(256, bbr_slab_pool_alloc, - bbr_slab_pool_free, - bbr_io_buf_slab); - if (!bbr_io_buf_pool) { - panic("Unable to create BBR I/O buffer pool."); - } - } - - return 0; -} - static void bbr_destroy_pools(void) { if (bbr_io_buf_pool) { @@ -913,6 +864,14 @@ kmem_cache_destroy(bbr_io_buf_slab); bbr_io_buf_slab = NULL; } + if (bbr_bh_pool) { + mempool_destroy(bbr_bh_pool); + bbr_bh_pool = NULL; + } + if (bbr_bh_slab) { + kmem_cache_destroy(bbr_bh_slab); + bbr_bh_slab = NULL; + } if (bbr_remap_pool) { mempool_destroy(bbr_remap_pool); bbr_remap_pool = NULL; @@ -923,6 +882,63 @@ } } +static int bbr_create_pools(void) +{ + /* Create a memory pool for the remap list. */ + bbr_remap_slab = kmem_cache_create("BBR_Remap_Slab", + sizeof(struct bbr_runtime_remap), + 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!bbr_remap_slab) { + LOG_ERROR("Unable to create BBR remap cache."); + goto error; + } + + bbr_remap_pool = mempool_create(64, bbr_slab_pool_alloc, + bbr_slab_pool_free, bbr_remap_slab); + if (!bbr_remap_pool) { + LOG_ERROR("Unable to create BBR remap pool."); + goto error; + } + + /* Create a memory pool for cloning buffer-heads. */ + bbr_bh_slab = kmem_cache_create("BBR_BH_Slab", + sizeof(struct buffer_head), + 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!bbr_bh_slab) { + LOG_ERROR("Unable to create BBR BH cache."); + goto error; + } + + bbr_bh_pool = mempool_create(256, bbr_slab_pool_alloc, + bbr_slab_pool_free, bbr_bh_slab); + if (!bbr_bh_pool) { + LOG_ERROR("Unable to create BBR BH pool."); + goto error; + } + + /* Create a memory pool for the BBR I/O anchors. */ + bbr_io_buf_slab = kmem_cache_create("BBR_IO_Buf_Slab", + sizeof(struct bbr_io_buffer), + 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!bbr_io_buf_slab) { + LOG_ERROR("Unable to create BBR I/O buffer cache."); + goto error; + } + + bbr_io_buf_pool = mempool_create(256, bbr_slab_pool_alloc, + bbr_slab_pool_free, bbr_io_buf_slab); + if (!bbr_io_buf_pool) { + LOG_ERROR("Unable to create BBR I/O buffer pool."); + goto error; + } + + return 0; + +error: + bbr_destroy_pools(); + return -ENOMEM; +} + /** * bbr_discover * @@ -1088,8 +1104,43 @@ return rc; } +static struct buffer_head * allocate_bbr_bh(struct buffer_head * org_bh) +{ + struct buffer_head * new_bh; + + new_bh = mempool_alloc(bbr_bh_pool, GFP_NOIO); + if (!new_bh) { + LOG_WARNING("Could not allocate from BBR BH pool!\n"); + return NULL; + } + + memset(new_bh, 0, sizeof(*new_bh)); + new_bh->b_size = org_bh->b_size; + new_bh->b_list = BUF_LOCKED; + new_bh->b_dev = org_bh->b_dev; + atomic_set(&new_bh->b_count, 1); + new_bh->b_rdev = org_bh->b_rdev; + set_bit(BH_Dirty, &new_bh->b_state); + set_bit(BH_Lock, &new_bh->b_state); + set_bit(BH_Req, &new_bh->b_state); + set_bit(BH_Mapped, &new_bh->b_state); + set_bit(BH_Uptodate, &new_bh->b_state); + new_bh->b_this_page = (struct buffer_head *)1; + new_bh->b_data = org_bh->b_data; + new_bh->b_page = org_bh->b_page; + new_bh->b_rsector = org_bh->b_rsector; + init_waitqueue_head(&new_bh->b_wait); + + return new_bh; +} + +static void free_bbr_bh(struct buffer_head * bh) +{ + mempool_free(bh, bbr_bh_pool); +} + static struct bbr_io_buffer * allocate_bbr_io_buf(struct bbr_private * bbr_id, - struct buffer_head * bh, + struct buffer_head * org_bh, int rw) { struct bbr_io_buffer * bbr_io_buf; @@ -1099,7 +1150,7 @@ memset(bbr_io_buf, 0, sizeof(struct bbr_io_buffer)); INIT_LIST_HEAD(&bbr_io_buf->bbr_io_list); bbr_io_buf->bbr_id = bbr_id; - bbr_io_buf->bh = bh; + bbr_io_buf->org_bh = org_bh; bbr_io_buf->rw = rw; } else { LOG_WARNING("Could not allocate from BBR I/O buffer pool!\n"); @@ -1249,10 +1300,10 @@ static int bbr_io_process_request(struct bbr_io_buffer * bbr_io_buf) { struct bbr_private * bbr_id = bbr_io_buf->bbr_id; - u64 starting_lsn = bbr_io_buf->bh->b_rsector; - u64 count = bbr_io_buf->bh->b_size >> EVMS_VSECTOR_SIZE_SHIFT; + u64 starting_lsn = bbr_io_buf->org_bh->b_rsector; + u64 count = bbr_io_buf->org_bh->b_size >> EVMS_VSECTOR_SIZE_SHIFT; u64 lsn, remapped_lsn; - char * buffer = bbr_io_buf->bh->b_data; + char * buffer = bbr_io_buf->org_bh->b_data; int rc = 0, rw = bbr_io_buf->rw; /* For each sector in this request, check if this sector has already @@ -1366,7 +1417,7 @@ rc = bbr_io_process_request(bbr_io_buf); /* Clean up and complete the original I/O. */ - bh = bbr_io_buf->bh; + bh = bbr_io_buf->org_bh; if (bh->b_end_io) { free_bbr_io_buf(bbr_io_buf); evms_cs_volume_request_in_progress(bh->b_rdev, -1, NULL); @@ -1401,7 +1452,7 @@ * to the thread for processing. Otherwise send it down the stack normally. */ static void bbr_read(struct evms_logical_node * bbr_node, - struct buffer_head * bh ) + struct buffer_head * bh) { struct bbr_private * bbr_id = bbr_node->private; struct bbr_io_buffer * bbr_io_buf; @@ -1432,7 +1483,7 @@ return; } - evms_cs_volume_request_in_progress(bbr_io_buf->bh->b_rdev, +1, NULL); + evms_cs_volume_request_in_progress(bh->b_rdev, +1, NULL); bbr_schedule_io(bbr_io_buf); } @@ -1446,21 +1497,20 @@ int uptodate) { struct bbr_io_buffer * bbr_io_buf = bh->b_private; + struct buffer_head * org_bh = bbr_io_buf->org_bh; - bh->b_end_io = bbr_io_buf->org_end_io; - bh->b_private = bbr_io_buf->org_private; - bh->b_rsector = bbr_io_buf->org_rsector; - bh->b_rdev = bbr_io_buf->org_dev; + free_bbr_bh(bh); if (!(bbr_io_buf->bbr_id->flag & BBR_STOP_REMAP) && !uptodate) { LOG_ERROR("Object %s: Write failure on sector ("PFU64"). Scheduling for retry.\n", - bbr_io_buf->bbr_id->node->name, (u64)bbr_io_buf->bh->b_rsector); + bbr_io_buf->bbr_id->node->name, + (u64)org_bh->b_rsector); bbr_schedule_io(bbr_io_buf); } else { free_bbr_io_buf(bbr_io_buf); - evms_cs_volume_request_in_progress(bh->b_rdev, -1, NULL); - bh->b_end_io(bh, uptodate); + evms_cs_volume_request_in_progress(org_bh->b_rdev, -1, NULL); + org_bh->b_end_io(org_bh, uptodate); } } @@ -1476,6 +1526,7 @@ { struct bbr_private * bbr_id = bbr_node->private; struct bbr_io_buffer * bbr_io_buf; + struct buffer_head * new_bh; if ( bh->b_rsector + (bh->b_size >> EVMS_VSECTOR_SIZE_SHIFT) > bbr_node->total_vsectors || @@ -1494,6 +1545,14 @@ return; } + new_bh = allocate_bbr_bh(bh); + if (!new_bh) { + /* Can't get memory to track the I/O. */ + free_bbr_io_buf(bbr_io_buf); + bh->b_end_io(bh, 0); + return; + } + evms_cs_volume_request_in_progress(bh->b_rdev, +1, NULL); if ( atomic_read(&bbr_id->in_use_replacement_blks) == 0 || @@ -1503,15 +1562,12 @@ /* No existing remaps, this request contains no remapped * sectors, or the engine said to stop remapping. */ - bbr_io_buf->org_end_io = bh->b_end_io; - bbr_io_buf->org_private = bh->b_private; - bbr_io_buf->org_rsector = bh->b_rsector; - bbr_io_buf->org_dev = bh->b_rdev; - bh->b_end_io = bbr_write_callback; - bh->b_private = bbr_io_buf; - W_IO(bbr_id->source, bh); + new_bh->b_private = bbr_io_buf; + new_bh->b_end_io = bbr_write_callback; + W_IO(bbr_id->source, new_bh); } else { /* This request contains at least one remapped sector. */ + free_bbr_bh(new_bh); bbr_schedule_io(bbr_io_buf); } } diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/evms_drivelink.c linux-2.4.19-evms-1.2.1/drivers/evms/evms_drivelink.c --- linux-2.4.19-evms-1.2.0/drivers/evms/evms_drivelink.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/evms_drivelink.c Wed Dec 18 14:51:48 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,7 @@ .version = { .major = 2, .minor = 0, - .patchlevel = 1 + .patchlevel = 2 }, .required_services_version = { .major = 0, diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/evms_ecr.c linux-2.4.19-evms-1.2.1/drivers/evms/evms_ecr.c --- linux-2.4.19-evms-1.2.0/drivers/evms/evms_ecr.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/evms_ecr.c Wed Dec 31 18:00:00 1969 @@ -1,213 +0,0 @@ -/* -*- linux-c -*- */ -/* - * - * Copyright (c) International Business Machines Corp., 2000 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* linux/driver/evms/evms_ecr.c - * - * EVMS - Cluster enablement (ECR) module - * - */ - - -#include -#include -#include -#include -#include -#include - -#define LOG_PREFIX "ecr: " - - -/* - * ecr_group_join - */ -ecr_group_t ecr_group_join(char *group_name, ecr_table_t *f_table, - ecr_cred_t * cred, size_t size, ecr_instance_t *instance) -{ - /* dummy */ - return ECR_FAIL; -} - - - - -/* - * ecr_group_leave - */ -void ecr_group_leave(ecr_group_t group) -{ - /* dummy */ - return; -} - - - -/* - * ecr_group_send - */ -int ecr_group_send(ecr_group_t group, ecr_nodeid_t node, void *message, - size_t size, ecr_instance_t *instance, - void callback(int ret, ecr_instance_t *instance)) -{ - /* dummy */ - return ECR_FAIL; -} - - - -/* - * ecr_group_send_wait - */ -int ecr_group_send_wait(ecr_group_t group, ecr_nodeid_t node, void *message, - size_t size, int *ret) -{ - /* dummy */ - *ret = ECR_FAIL; - return ECR_FAIL; -} - - - -/* - * ecr_group_broadcast - */ -int ecr_group_broadcast(ecr_group_t group, void *message, size_t size, - ecr_instance_t *instance, - void callback(u_char ret, ecr_instance_t *instance)) -{ - /* dummy */ - return ECR_FAIL; -} - - - -/* - * ecr_group_broadcast_wait - */ -int ecr_group_broadcast_wait(ecr_group_t group, void *message, size_t size, - u_char *ret) -{ - /* dummy */ - *ret = ECR_FAIL; - return ECR_FAIL; -} - - - -/* - * ecr_group_atomic_execute - */ -int ecr_group_atomic_execute(ecr_group_t group, void *message, size_t size, - ecr_instance_t *instance, - void callback(ecr_instance_t *instance)) -{ - /* dummy */ - return ECR_FAIL; -} - - - -/* - * ecr_group_atomic_execute_wait - */ -int ecr_group_atomic_execute_wait(ecr_group_t group, void *message, size_t size) -{ - /* dummy */ - return ECR_FAIL; -} - - - -/* - * ecr_group_success_response - */ -void ecr_group_success_response(ecr_message_t *handle) -{ - /* dummy */ - return; -} - - - - -/* - * ecr_group_failure_response - */ -void ecr_group_failure_response(ecr_message_t *handle, int ret) -{ - /* dummy */ - return; -} - - - -/* - * ecr_lock_create - */ -ecr_lock_t ecr_lock_create(char *lockname) -{ - /* dummy */ - return ECR_FAIL; -} - -/* - * ecr_lock - */ -int ecr_lock(ecr_lock_t lock, u64 start, u64 length, - ecr_lock_mode_t mode, u_char flag) -{ - /* dummy */ - return ECR_FAIL; -} - - - -/* - * ecr_unlock - */ -int ecr_unlock(ecr_lock_t lock, u64 start, u64 length) -{ - /* dummy */ - return ECR_FAIL; -} - - -/********************************************************/ -/* Required Module Entry Point: */ -/* ecr_init() */ -/********************************************************/ - -static int __init ecr_init(void) -{ - /* dummy */ - return 0; -} - -static void __exit ecr_exit(void) -{ - return; -} - -module_init(ecr_init); -module_exit(ecr_exit); -#ifdef MODULE_LICENSE -MODULE_LICENSE("GPL"); -#endif - diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/evms_passthru.c linux-2.4.19-evms-1.2.1/drivers/evms/evms_passthru.c --- linux-2.4.19-evms-1.2.0/drivers/evms/evms_passthru.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/evms_passthru.c Wed Dec 18 14:51:48 2002 @@ -69,7 +69,7 @@ .version = { .major = 1, .minor = 1, - .patchlevel = 1 + .patchlevel = 2 }, .required_services_version = { .major = 0, diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/gpt_part.c linux-2.4.19-evms-1.2.1/drivers/evms/gpt_part.c --- linux-2.4.19-evms-1.2.0/drivers/evms/gpt_part.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/gpt_part.c Wed Dec 18 14:51:48 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -211,7 +212,7 @@ .version = { .major = 1, .minor = 1, - .patchlevel = 1 + .patchlevel = 2 }, .required_services_version = { .major = 0, @@ -722,7 +723,6 @@ struct evms_logical_node *node) { int rc; - int nextminor = 1; int evms_top_segment; u32 i; u64 pstart,pend; @@ -769,11 +769,8 @@ node, pstart, (pend - pstart + 1), - 0, nextminor, evms_top_segment); + 0, i+1, evms_top_segment); - if (!rc) { - ++nextminor; - } } } diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/ldev_mgr.c linux-2.4.19-evms-1.2.1/drivers/evms/ldev_mgr.c --- linux-2.4.19-evms-1.2.0/drivers/evms/ldev_mgr.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/ldev_mgr.c Wed Dec 18 14:51:48 2002 @@ -97,7 +97,7 @@ .version = { .major = 1, .minor = 1, - .patchlevel = 1 + .patchlevel = 2 }, .required_services_version = { .major = 0, @@ -525,10 +525,10 @@ /* This is a generic device */ rc = 0; - LOG_DEBUG("major name = %s\n", gd->major_name); - LOG_DEBUG("number of real devices = %i\n", gd->nr_real); + LOG_EXTRA("major name = %s\n", gd->major_name); + LOG_EXTRA("number of real devices = %i\n", gd->nr_real); for (i = 0; i < gd->nr_real; i++) { - LOG_DEBUG("device %d:\n", i); + LOG_EXTRA("device %d:\n", i); rc = create_logical_disk(disk_list, gd, i); if (rc) break; @@ -545,7 +545,7 @@ ide_drive_t *drive; /* This is an IDE device */ - LOG_DEBUG("found IDE major : %i - searching for disks\n", gd->major); + LOG_EXTRA("found IDE major : %i - searching for disks\n", gd->major); ide_hwif = gd->real_devices; /* IDE internal data */ for (i = 0; i < MAX_DRIVES; i++) { @@ -570,13 +570,13 @@ Scsi_Device *SDev; /* This is an SCSI device */ - LOG_DEBUG("found SCSI major : %i - searching for disks\n", gd->major); - LOG_DEBUG("scsi: major name = %s\n", gd->major_name); - LOG_DEBUG("scsi: number of real devices = %i\n", gd->nr_real); + LOG_EXTRA("found SCSI major : %i - searching for disks\n", gd->major); + LOG_EXTRA("scsi: major name = %s\n", gd->major_name); + LOG_EXTRA("scsi: number of real devices = %i\n", gd->nr_real); SDisks = gd->real_devices; /* SCSI internal data */ for (i = 0; i < gd->nr_real; i++) { SDev = SDisks[i].device; - LOG_DEBUG + LOG_EXTRA ("scsi: Channel = %i, Id = %i, Lun = %i, Capacity = %i\n", SDev->channel, SDev->id, SDev->lun, SDisks[i].capacity); rc = create_logical_disk(disk_list, gd, i); @@ -604,7 +604,7 @@ rc = create_logical_generic_disks(disk_list, gd); break; default: - LOG_DEBUG("unrecognized device major : %i\n", gd->major); + LOG_EXTRA("unrecognized device major : %i\n", gd->major); break; } @@ -1119,7 +1119,7 @@ /* initialize the buffer head control block */ memset(&bh_cb, 0, sizeof (bh_cb_t)); init_waitqueue_head(&bh_cb.cb_wait); - bh_cb.blks_allocated = (atomic_t)ATOMIC_INIT(0); + atomic_set(&bh_cb.blks_allocated, 0); /* only update the local copy of variables */ cur_bufptr = bufptr; diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/lvm_vge.c linux-2.4.19-evms-1.2.1/drivers/evms/lvm_vge.c --- linux-2.4.19-evms-1.2.0/drivers/evms/lvm_vge.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/lvm_vge.c Wed Dec 18 14:51:48 2002 @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -605,7 +607,7 @@ unsigned long buffer_size = IO_BUFFER_SECTORS * EVMS_VSECTOR_SIZE; int i, rc = 1; - if (group->lv_array) { + if (group->lv_array_disk) { return 0; } @@ -627,7 +629,8 @@ * start over with the next PV in the group. */ while (rc && pv_entry) { - start_sector = evms_cs_size_in_vsectors(pv_entry->pv->lv_on_disk.base); + //start_sector = evms_cs_size_in_vsectors(pv_entry->pv->lv_on_disk.base); + start_sector = pv_entry->pv->lv_on_disk.base >> EVMS_VSECTOR_SIZE_SHIFT; total_sectors = evms_cs_size_in_vsectors(pv_entry->pv->lv_on_disk.size); lv_array_size = round_up(total_sectors * EVMS_VSECTOR_SIZE, buffer_size); @@ -635,18 +638,20 @@ /* Allocate the buffer for this group to * hold the entire LV array. */ - if (group->lv_array) { - vfree(group->lv_array); - group->lv_array = NULL; + if (group->lv_array_disk) { + vfree(group->lv_array_disk); + group->lv_array_disk = group->lv_array = NULL; } - group->lv_array = vmalloc(lv_array_size); - if (!group->lv_array) { + group->lv_array_disk = vmalloc(lv_array_size); + if (!group->lv_array_disk) { LOG_CRITICAL("Error allocating lv_array buffer for Group %s\n", group->vg_name); rc = -ENOMEM; goto out_kfree; } - memset(group->lv_array, 0, lv_array_size); + memset(group->lv_array_disk, 0, lv_array_size); + group->lv_array = (struct lv_disk*)((unsigned long)group->lv_array_disk + + (pv_entry->pv->lv_on_disk.base & (EVMS_VSECTOR_SIZE - 1))); for ( i = 0; i < total_sectors; i += IO_BUFFER_SECTORS ) { rc = INIT_IO(pv_entry->logical_node, 0, @@ -664,7 +669,7 @@ break; } /* Copy the I/O buffer into the lv_array. */ - memcpy(&(((char *)(group->lv_array))[i * EVMS_VSECTOR_SIZE]), + memcpy(&(((char *)(group->lv_array_disk))[i * EVMS_VSECTOR_SIZE]), lv_buffer, buffer_size); } } @@ -676,7 +681,7 @@ } /* Clear out the unused portion at the end of the lv_array. */ - memset(&(((char *)(group->lv_array))[pv_entry->pv->lv_on_disk.size]), + memset(&(((char *)(group->lv_array_disk))[pv_entry->pv->lv_on_disk.size]), 0, lv_array_size - pv_entry->pv->lv_on_disk.size); /* Endian-neutral conversion of the LV metadata. */ @@ -687,8 +692,8 @@ return rc; out_vfree: - vfree(group->lv_array); - group->lv_array = NULL; + vfree(group->lv_array_disk); + group->lv_array_disk = group->lv_array = NULL; goto out_kfree; } @@ -1665,9 +1670,9 @@ remove_group_from_list(group); /* Delete the LV metadata array. */ - if (group->lv_array) { - vfree(group->lv_array); - group->lv_array = NULL; + if (group->lv_array_disk) { + vfree(group->lv_array_disk); + group->lv_array_disk = group->lv_array = NULL; } /* Delete the PV UUID list. */ @@ -3030,9 +3035,9 @@ pv_entry->pe_map = NULL; } } - if (group->lv_array) { - vfree(group->lv_array); - group->lv_array = NULL; + if (group->lv_array_disk) { + vfree(group->lv_array_disk); + group->lv_array_disk = group->lv_array = NULL; } if (group->uuid_list) { vfree(group->uuid_list); diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/md_core.c linux-2.4.19-evms-1.2.1/drivers/evms/md_core.c --- linux-2.4.19-evms-1.2.0/drivers/evms/md_core.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/md_core.c Wed Dec 18 14:51:48 2002 @@ -494,7 +494,7 @@ while ((bh = evms_cs_allocate_from_pool(evms_bh_pool, FALSE)) == NULL) schedule(); /* just yield for a someone to deallocate a bh */ init_waitqueue_head(&bh->b_wait); - bh->b_count = (atomic_t)ATOMIC_INIT(0); + atomic_set(&bh->b_count, 0); return(bh); } @@ -544,7 +544,7 @@ if (!rc) { memset(&cb, 0, sizeof(cb)); init_waitqueue_head(&cb.wait); - cb.io_count = (atomic_t)ATOMIC_INIT(0); + atomic_set(&cb.io_count, 0); md_sync_request_submit_bh( node, bh, (unsigned long)(sector & EVMS_MD_SECTS_PER_PAGE_MASK), @@ -624,7 +624,7 @@ memset(&cb, 0, sizeof(cb)); init_waitqueue_head(&cb.wait); - cb.io_count = (atomic_t)ATOMIC_INIT(0); + atomic_set(&cb.io_count, 0); while (!rc && total_nr_pages) { @@ -1031,8 +1031,8 @@ INIT_LIST_HEAD(&mddev->all_mddevs); INIT_LIST_HEAD(&mddev->incomplete_mddevs); INIT_LIST_HEAD(&mddev->running_mddevs); - mddev->active = (atomic_t)ATOMIC_INIT(0); - mddev->recovery_active = (atomic_t)ATOMIC_INIT(0); + atomic_set(&mddev->active, 0); + atomic_set(&mddev->recovery_active, 0); /* * The 'base' mddev is the one with data NULL. diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/md_raid1.c linux-2.4.19-evms-1.2.1/drivers/evms/md_raid1.c --- linux-2.4.19-evms-1.2.0/drivers/evms/md_raid1.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/md_raid1.c Wed Dec 18 14:51:48 2002 @@ -726,21 +726,21 @@ return sz; } -#define LAST_DISK KERN_ALERT \ -"EVMS raid1: only one disk left and IO error.\n" +#define LAST_DISK \ +"only one disk left and IO error.\n" -#define NO_SPARE_DISK KERN_ALERT \ -"EVMS raid1: no spare disk left, degrading mirror level by one.\n" +#define NO_SPARE_DISK \ +"no spare disk left, degrading mirror level by one.\n" -#define DISK_FAILED KERN_ALERT \ -"EVMS raid1: Disk failure on %s, disabling device. \n" \ +#define DISK_FAILED \ +"disk failure on %s, disabling device. \n" \ " Operation continuing on %d devices\n" -#define START_SYNCING KERN_ALERT \ -"EVMS raid1: start syncing spare disk.\n" +#define START_SYNCING \ +"start syncing spare disk.\n" -#define ALREADY_SYNCING KERN_INFO \ -"EVMS raid1: syncing already in progress.\n" +#define ALREADY_SYNCING \ +"syncing already in progress.\n" static void mark_disk_bad (mddev_t *mddev, int failed) { @@ -1151,11 +1151,11 @@ } -#define IO_ERROR KERN_ALERT \ -"EVMS raid1: %s: unrecoverable I/O read error for block %lu\n" +#define IO_ERROR \ +"%s: unrecoverable I/O read error for block %lu\n" -#define REDIRECT_SECTOR KERN_ERR \ -"EVMS raid1: %s: redirecting sector %lu to another mirror\n" +#define REDIRECT_SECTOR \ +"%s: redirecting sector %lu to another mirror\n" /* * This is a kernel thread which: @@ -1176,12 +1176,12 @@ mdk_rdev_t *rdev; kdev_t dev; struct evms_logical_node *node; - raid1_conf_t *conf = (raid1_conf_t *) data; + raid1_conf_t *conf = (raid1_conf_t *) data; for (;;) { mddev = conf->mddev; if (mddev->sb_dirty) { - LOG_DEFAULT("EVMS raid1: dirty sb detected, updating.\n"); + LOG_DEFAULT("dirty sb detected, updating.\n"); mddev->sb_dirty = 0; evms_md_update_sb(mddev); } @@ -1206,6 +1206,10 @@ conf = mddev_to_conf(mddev); bhl = raid1_alloc_bh(conf, conf->raid_disks); /* don't really need this many */ + if (r1_bh->mirror_bh_list) { + MD_BUG(); + r1_bh->mirror_bh_list = NULL; + } for (i = 0; i < disks ; i++) { if (!conf->mirrors[i].operational) continue; @@ -1227,14 +1231,14 @@ mbh->b_this_page = (struct buffer_head *)1; - /* - * prepare mirrored bh (fields ordered for max mem throughput): - */ + /* + * prepare mirrored bh (fields ordered for max mem throughput): + */ mbh->b_blocknr = bh->b_blocknr; mbh->b_dev = conf->mirrors[i].dev; mbh->b_rsector = bh->b_blocknr; mbh->b_state = (1<b_count, 1); mbh->b_size = bh->b_size; mbh->b_page = bh->b_page; @@ -1250,7 +1254,6 @@ } atomic_set(&r1_bh->remaining, sum_bhs); if (bhl) raid1_free_bh(conf, bhl); - mbh = r1_bh->mirror_bh_list; if (!sum_bhs) { /* nowhere to write this too... I guess we @@ -1262,15 +1265,14 @@ 0); raid1_free_buf(r1_bh); } else { - while (mbh) { + for (mbh = r1_bh->mirror_bh_list; mbh; mbh = bhl) { + bhl = mbh->b_next; node = (struct evms_logical_node *)mbh->b_private; mbh->b_private = r1_bh; - - W_IO(node, mbh); evms_md_sync_acct(mbh->b_dev, bh->b_size >> EVMS_VSECTOR_SIZE_SHIFT); - mbh = mbh->b_next; + W_IO(node, mbh); } } } else { @@ -1532,44 +1534,44 @@ } } -#define INVALID_LEVEL KERN_WARNING \ -"EVMS raid1: md%d: raid level not set to mirroring (%d)\n" +#define INVALID_LEVEL \ +"md%d: raid level not set to mirroring (%d)\n" -#define NO_SB KERN_ERR \ -"EVMS raid1: disabled mirror %s (couldn't access raid superblock)\n" +#define NO_SB \ +"disabled mirror %s (couldn't access raid superblock)\n" -#define ERRORS KERN_ERR \ -"EVMS raid1: disabled mirror %s (errors detected)\n" +#define ERRORS \ +"disabled mirror %s (errors detected)\n" -#define NOT_IN_SYNC KERN_ERR \ -"EVMS raid1: disabled mirror %s (not in sync)\n" +#define NOT_IN_SYNC \ +"disabled mirror %s (not in sync)\n" -#define INCONSISTENT KERN_ERR \ -"EVMS raid1: disabled mirror %s (inconsistent descriptor)\n" +#define INCONSISTENT \ +"disabled mirror %s (inconsistent descriptor)\n" -#define ALREADY_RUNNING KERN_ERR \ -"EVMS raid1: disabled mirror %s (mirror %d already operational)\n" +#define ALREADY_RUNNING \ +"disabled mirror %s (mirror %d already operational)\n" -#define OPERATIONAL KERN_INFO \ -"EVMS raid1: device %s operational as mirror %d\n" +#define OPERATIONAL \ +"device %s operational as mirror %d\n" -#define MEM_ERROR KERN_ERR \ -"EVMS raid1: couldn't allocate memory for md%d\n" +#define MEM_ERROR \ +"couldn't allocate memory for md%d\n" -#define SPARE KERN_INFO \ -"EVMS raid1: spare disk %s\n" +#define SPARE \ +"spare disk %s\n" -#define NONE_OPERATIONAL KERN_ERR \ -"EVMS raid1: no operational mirrors for md%d\n" +#define NONE_OPERATIONAL \ +"no operational mirrors for md%d\n" -#define ARRAY_IS_ACTIVE KERN_INFO \ -"EVMS raid1: raid set md%d active with %d out of %d mirrors\n" +#define ARRAY_IS_ACTIVE \ +"raid set md%d active with %d out of %d mirrors\n" -#define THREAD_ERROR KERN_ERR \ -"EVMS raid1: couldn't allocate thread for md%d\n" +#define THREAD_ERROR \ +"couldn't allocate thread for md%d\n" -#define START_RESYNC KERN_WARNING \ -"EVMS raid1: raid set md%d not clean; reconstructing mirrors\n" +#define START_RESYNC \ +"raid set md%d not clean; reconstructing mirrors\n" static int raid1_run (mddev_t *mddev) { diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/md_raid5.c linux-2.4.19-evms-1.2.1/drivers/evms/md_raid5.c --- linux-2.4.19-evms-1.2.0/drivers/evms/md_raid5.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/md_raid5.c Wed Dec 18 14:51:48 2002 @@ -175,7 +175,7 @@ kfree(bh); return 1; } - bh->b_count = (atomic_t)ATOMIC_INIT(0); + atomic_set(&bh->b_count, 0); bh->b_page = page; sh->bh_cache[i] = bh; @@ -354,7 +354,7 @@ return 1; } /* we just created an active stripe so... */ - sh->count = (atomic_t)ATOMIC_INIT(1); + atomic_set(&sh->count, 1); atomic_inc(&conf->active_stripes); INIT_LIST_HEAD(&sh->lru); release_stripe(sh); @@ -772,7 +772,7 @@ else bhp = &sh->bh_write[dd_idx]; while (*bhp) { - LOG_DEFAULT("EVMS RAID5: multiple %d requests for sector %ld\n", + LOG_DEFAULT("multiple %d requests for sector %ld\n", rw, sh->sector); bhp = &(*bhp)->b_reqnext; } @@ -1417,8 +1417,8 @@ INIT_LIST_HEAD(&conf->handle_list); INIT_LIST_HEAD(&conf->delayed_list); INIT_LIST_HEAD(&conf->inactive_list); - conf->active_stripes = (atomic_t)ATOMIC_INIT(0); - conf->preread_active_stripes = (atomic_t)ATOMIC_INIT(0); + atomic_set(&conf->active_stripes, 0); + atomic_set(&conf->preread_active_stripes, 0); conf->buffer_size = PAGE_SIZE; /* good default for rebuild */ conf->plugged = 0; diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/os2lvm_vge.c linux-2.4.19-evms-1.2.1/drivers/evms/os2lvm_vge.c --- linux-2.4.19-evms-1.2.0/drivers/evms/os2lvm_vge.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/os2lvm_vge.c Wed Dec 18 14:51:48 2002 @@ -171,7 +171,7 @@ .version = { .major = 1, .minor = 1, - .patchlevel = 1 + .patchlevel = 2 }, .required_services_version = { .major = EVMS_COMMON_SERVICES_MAJOR, @@ -2373,7 +2373,7 @@ Child->b_size = Source->b_size; Child->b_list = BUF_LOCKED; Child->b_dev = Source->b_dev; - Child->b_count = (atomic_t) ATOMIC_INIT(0); + atomic_set(&Child->b_count, 0); atomic_set(&Child->b_count, atomic_read(&Source->b_count)); Child->b_rdev = Source->b_rdev; Child->b_state = Source->b_state; diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/s390_part.c linux-2.4.19-evms-1.2.1/drivers/evms/s390_part.c --- linux-2.4.19-evms-1.2.0/drivers/evms/s390_part.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/s390_part.c Wed Dec 18 14:51:48 2002 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -88,8 +89,8 @@ EVMS_S390_PARTITION_MANAGER_ID), .version = { .major = 1, - .minor = 0, - .patchlevel = 0}, + .minor = 1, + .patchlevel = 2}, .required_services_version = { .major = 0, .minor = 5, @@ -1435,6 +1436,7 @@ static void __exit s390_part_exit(void) { + evms_cs_destroy_pool(s390_io_track_pool); evms_cs_unregister_plugin(&plugin_header); } diff -Naur linux-2.4.19-evms-1.2.0/drivers/evms/snapshot.c linux-2.4.19-evms-1.2.1/drivers/evms/snapshot.c --- linux-2.4.19-evms-1.2.0/drivers/evms/snapshot.c Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/drivers/evms/snapshot.c Wed Dec 18 14:51:48 2002 @@ -33,8 +33,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -915,7 +917,7 @@ /* Initialize the rest of the buffer. */ bh->b_size = PAGE_SIZE; bh->b_list = BUF_LOCKED; - bh->b_count = (atomic_t)ATOMIC_INIT(1); + atomic_set(&bh->b_count, 1); bh->b_this_page = (struct buffer_head *)1; bh->b_private = buf; set_bit(BH_Dirty, &bh->b_state); @@ -1022,7 +1024,7 @@ async_snap_io->org_io = async_org_io; INIT_LIST_HEAD(&async_snap_io->snap_pending_io_list); INIT_LIST_HEAD(&async_snap_io->cow_write_list); - async_snap_io->write_count = (atomic_t)ATOMIC_INIT(buffer_count); + atomic_set(&async_snap_io->write_count, buffer_count); async_snap_io->cow_table_buffer = snap_allocate_buffer(TRUE); if (async_snap_io->cow_table_buffer) { @@ -1081,8 +1083,8 @@ async_org_io->org_volume = org_volume; spin_lock_init(&async_org_io->pending_writes_lock); INIT_LIST_HEAD(&async_org_io->org_pending_io_list); - async_org_io->copy_count = (atomic_t)ATOMIC_INIT(0); - async_org_io->ref_count = (atomic_t)ATOMIC_INIT(1); + atomic_set(&async_org_io->copy_count, 0); + atomic_set(&async_org_io->ref_count, 1); async_org_io->copy_buffers = snap_allocate_buffer_list(buffer_count, @@ -2313,8 +2315,8 @@ spin_lock_init(&snap_volume->cow_table_write_list_lock); #ifdef SNAPSHOT_DEBUG - snap_volume->cow_table_writes = (atomic_t)ATOMIC_INIT(0); - snap_volume->cow_table_overlaps = (atomic_t)ATOMIC_INIT(0); + atomic_set(&snap_volume->cow_table_writes, 0); + atomic_set(&snap_volume->cow_table_overlaps, 0); #endif if ( metadata->flags & EVMS_SNAPSHOT_ROLLBACK ) { diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms.h Wed Dec 18 14:51:48 2002 @@ -24,24 +24,19 @@ */ #ifndef __EVMS_INCLUDED__ -#define __EVMS_INCLUDED__ +#define __EVMS_INCLUDED__ 1 -#include +#include #include -#include -#include -#include -#include #include -#include -#include +#include /** * version info **/ #define EVMS_MAJOR_VERSION 1 #define EVMS_MINOR_VERSION 2 -#define EVMS_PATCHLEVEL_VERSION 0 +#define EVMS_PATCHLEVEL_VERSION 1 /** * general defines section @@ -83,16 +78,11 @@ extern int evms_info_level; /** - * kernel logging macros - **/ -#define evmsLOG(info_level,prspec) { if (evms_info_level >= info_level) printk prspec; } -#define evmsLOG2(info_level,statement) { if (evms_info_level >= info_level) statement; } - -/** * LOG MACROS to make evms log messages * look much cleaner in the source. **/ #define EVMS_LOG_PREFIX "evms: " +#define evmsLOG(info_level, prspec) { if (evms_info_level >= info_level) printk prspec; } #define LOG_CRITICAL(msg, args...) evmsLOG(EVMS_INFO_CRITICAL, (KERN_CRIT EVMS_LOG_PREFIX LOG_PREFIX msg, ## args)) #define LOG_SERIOUS(msg, args...) evmsLOG(EVMS_INFO_SERIOUS, (KERN_ERR EVMS_LOG_PREFIX LOG_PREFIX msg, ## args)) #define LOG_ERROR(msg, args...) evmsLOG(EVMS_INFO_ERROR, (KERN_ERR EVMS_LOG_PREFIX LOG_PREFIX msg, ## args)) @@ -121,13 +111,11 @@ /** * helpful PROCFS macro **/ -#ifdef CONFIG_PROC_FS #define PROCPRINT(msg, args...) (sz += sprintf(page + sz, msg, ## args));\ if (sz < off)\ off -= sz, sz = 0;\ else if (sz >= off + count)\ goto out -#endif /** * PluginID convenience macros @@ -337,10 +325,9 @@ /** * macro to obtain a node's name from either EVMS or compatibility volumes **/ -#define EVMS_GET_NODE_NAME(node) \ - ((node->flags & EVMS_VOLUME_FLAG) ? \ - node->volume_info->volume_name : \ - node->name) +#define EVMS_GET_NODE_NAME(node) ((node->flags & EVMS_VOLUME_FLAG) ? \ + node->volume_info->volume_name : \ + node->name) /** * macro used to transform to/from userland device handles and device storage object nodes @@ -356,11 +343,11 @@ * @flags: characteristics of logical volume * @quiesced: quiesce state info * @vfs_quiesced: vfs quiesce state info + * @opens: count of times the volume has been opened * @requests_in_progress: count of in-flight I/Os * @wait_queue: used when volume is quiesced * @devfs_handle: handle for devfs * @request_queue: unique request queue - * @request_lock: unique request queue lock * * contains all the fields needed to manage to a logical volume **/ @@ -374,10 +361,7 @@ atomic_t requests_in_progress; wait_queue_head_t wait_queue; devfs_handle_t devfs_handle; -#ifdef CONFIG_SMP request_queue_t request_queue; - spinlock_t request_lock; -#endif }; /** @@ -512,55 +496,49 @@ #define EVMS_COMMON_SERVICES_MINOR 6 #define EVMS_COMMON_SERVICES_PATCHLEVEL 0 -void evms_cs_get_version(int *, int *); -int evms_cs_check_version(struct evms_version *, struct evms_version *); -int evms_cs_register_plugin(struct evms_plugin_header *); -int evms_cs_unregister_plugin(struct evms_plugin_header *); -#ifdef EVMS_MEM_DEBUG -int evms_cs_verify_memory_integrity(int); -#endif -int evms_cs_allocate_logical_node(struct evms_logical_node **); -void evms_cs_deallocate_volume_info(struct evms_logical_node *); -void evms_cs_deallocate_logical_node(struct evms_logical_node *); -int evms_cs_add_logical_node_to_list(struct evms_logical_node **, +extern int evms_cs_check_version(struct evms_version *, struct evms_version *); +extern int evms_cs_allocate_logical_node(struct evms_logical_node **); +extern void evms_cs_deallocate_volume_info(struct evms_logical_node *); +extern void evms_cs_deallocate_logical_node(struct evms_logical_node *); +extern int evms_cs_register_plugin(struct evms_plugin_header *); +extern int evms_cs_unregister_plugin(struct evms_plugin_header *); +extern int evms_cs_add_logical_node_to_list(struct evms_logical_node **, struct evms_logical_node *); -int evms_cs_remove_logical_node_from_list(struct evms_logical_node **, +extern int evms_cs_remove_logical_node_from_list(struct evms_logical_node **, struct evms_logical_node *); -int evms_cs_kernel_ioctl(struct evms_logical_node *, u32, - unsigned long); +extern int evms_cs_kernel_ioctl(struct evms_logical_node *, u32, unsigned long); inline unsigned long evms_cs_size_in_vsectors(long long); inline int evms_cs_log2(long long); -u32 evms_cs_calculate_crc(u32, void *, u32); -int evms_cs_register_for_end_io_notification(void *, - struct buffer_head *, - void *callback_function); -struct evms_pool_mgmt *evms_cs_create_pool(int, - u8 *, - void (*ctor) (void *, kmem_cache_t *, - unsigned long), - void (*dtor) (void *, kmem_cache_t *, - unsigned long)); -#define EVMS_BLOCKABLE TRUE -void *evms_cs_allocate_from_pool(struct evms_pool_mgmt *, int); -void evms_cs_deallocate_to_pool(struct evms_pool_mgmt *, void *); -void evms_cs_destroy_pool(struct evms_pool_mgmt *); -struct evms_list_node **evms_cs_lookup_item_in_list(struct evms_list_node **, - void *); -int evms_cs_add_item_to_list(struct evms_list_node **, void *); -int evms_cs_remove_item_from_list(struct evms_list_node **, void *); -int evms_cs_register_device(struct evms_logical_node *); -int evms_cs_unregister_device(struct evms_logical_node *); -int evms_cs_find_next_device(struct evms_logical_node *, - struct evms_logical_node **); -void evms_cs_signal_event(int); -struct evms_thread *evms_cs_register_thread(void (*run) (void *), - void *data, const u8 *name); -void evms_cs_unregister_thread(struct evms_thread *thread); -void evms_cs_wakeup_thread(struct evms_thread *thread); -void evms_cs_interrupt_thread(struct evms_thread *thread); -struct proc_dir_entry *evms_cs_get_evms_proc_dir(void); -int evms_cs_volume_request_in_progress(kdev_t, int, int *); -void evms_cs_invalidate_volume(struct evms_logical_node *topmost_node); +extern u32 evms_cs_calculate_crc(u32, void *, u32); +#define EVMS_BLOCKABLE TRUE +extern struct evms_pool_mgmt *evms_cs_create_pool(int, u8 *, + void (*ctor)(void *, kmem_cache_t *, + unsigned long), + void (*dtor)(void *, kmem_cache_t *, + unsigned long)); +extern void *evms_cs_allocate_from_pool(struct evms_pool_mgmt *, int); +extern void evms_cs_deallocate_to_pool(struct evms_pool_mgmt *, void *); +extern void evms_cs_destroy_pool(struct evms_pool_mgmt *); +extern int evms_cs_register_for_end_io_notification(void *, + struct buffer_head *, + void *callback_function); +extern struct evms_list_node **evms_cs_lookup_item_in_list(struct evms_list_node **, + void *); +extern int evms_cs_add_item_to_list(struct evms_list_node **, void *); +extern int evms_cs_remove_item_from_list(struct evms_list_node **, void *); +extern int evms_cs_register_device(struct evms_logical_node *); +extern int evms_cs_unregister_device(struct evms_logical_node *); +extern int evms_cs_find_next_device(struct evms_logical_node *, + struct evms_logical_node **); +extern void evms_cs_signal_event(int); +extern struct evms_thread *evms_cs_register_thread(void (*run)(void *), + void *data, const u8 *name); +extern void evms_cs_unregister_thread(struct evms_thread *thread); +extern void evms_cs_wakeup_thread(struct evms_thread *thread); +extern void evms_cs_interrupt_thread(struct evms_thread *thread); +extern struct proc_dir_entry *evms_cs_get_evms_proc_dir(void); +extern int evms_cs_volume_request_in_progress(kdev_t, int, int *); +extern void evms_cs_invalidate_volume(struct evms_logical_node *topmost_node); /* EVMS exported global variables */ extern struct evms_pool_mgmt *evms_bh_pool; @@ -573,3 +551,4 @@ #include #endif + diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms_bbr_k.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms_bbr_k.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms_bbr_k.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms_bbr_k.h Wed Dec 18 14:51:48 2002 @@ -26,11 +26,11 @@ */ #ifndef __EVMS_BBR_K__ -#define __EVMS_BBR_K__ +#define __EVMS_BBR_K__ 1 #define EVMS_BBR_VERSION_MAJOR 1 #define EVMS_BBR_VERSION_MINOR 1 -#define EVMS_BBR_VERSION_PATCHLEVEL 1 +#define EVMS_BBR_VERSION_PATCHLEVEL 2 #define EVMS_BBR_COMMON_SERVICES_MAJOR 0 #define EVMS_BBR_COMMON_SERVICES_MINOR 6 @@ -163,7 +163,7 @@ * @in_use_replacement_blks: Current number of remaps. * @remap_root: Binary tree containing all remaps. * @bbr_id_lock: Lock for the binary tree. - * @flags: BBR_STOP_REMAP + * @flag: BBR_STOP_REMAP */ struct bbr_private { struct bbr_private * next; @@ -200,12 +200,8 @@ struct bbr_io_buffer { struct list_head bbr_io_list; struct bbr_private * bbr_id; - struct buffer_head * bh; - void (* org_end_io)(struct buffer_head *bh, int uptodate); - void * org_private; - u64 org_rsector; + struct buffer_head * org_bh; struct completion * complete; - kdev_t org_dev; s32 rw; s32 rc; }; diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms_ecr.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms_ecr.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms_ecr.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms_ecr.h Wed Dec 31 18:00:00 1969 @@ -1,107 +0,0 @@ -/* - * - * Copyright (c) International Business Machines Corp., 2000 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -/* - * linux/include/linux/evms_ecr.h - * - * EVMS Cluster enablement kernel header file - * - */ - -#ifndef __EVMS_ECR__ - -#define __EVMS_ECR__ - -#define ECR_SUCCESS 0 -#define ECR_FAIL -1 - -/* - * Beginning of group messaging API - */ -typedef int ecr_group_t; -typedef int ecr_nodeid_t; -typedef void ecr_cred_t; -typedef void ecr_instance_t; -typedef void ecr_message_t; - -typedef enum ecr_type_s { - ECR_GROUP_START, /* 0th entry is reserved */ - ECR_P2P, /* Point to Point message type */ - ECR_BROADCAST, /* Broadcast message type */ - ECR_ATOMIC_EXECUTE, /* Atomic execute type */ - ECR_GROUP_LAST /* Just a last enum type, not a message type */ -} ecr_type_t; - -typedef struct ecr_table_s { - void (*join) (ecr_nodeid_t, uint, ecr_nodeid_t *, ecr_instance_t *); - int (*can_join)(ecr_nodeid_t, ecr_cred_t *, size_t, ecr_instance_t *); - void (*leave) (ecr_nodeid_t, ecr_instance_t *); - void (*recover)(ecr_nodeid_t, ecr_instance_t *); - void (*message)(ecr_message_t *, ecr_type_t, ecr_nodeid_t, - void *, size_t, ecr_instance_t *); - void (*vol_leave)(ecr_nodeid_t, ecr_instance_t *); -} ecr_table_t; - - -#define ECR_GROUPNAME_MAX_SIZE NAME_SIZE /* maximum size of a group name */ - -ecr_group_t ecr_group_join(char *, ecr_table_t *, ecr_cred_t *, size_t, - ecr_instance_t *); -void ecr_group_leave(ecr_group_t); -int ecr_group_send(ecr_group_t, ecr_nodeid_t, void *, size_t, - ecr_instance_t *, - void callback(int, ecr_instance_t *)); -int ecr_group_send_wait(ecr_group_t, ecr_nodeid_t, void *, size_t, - int *); -int ecr_group_broadcast(ecr_group_t, void *, size_t, ecr_instance_t *, - void callback(u_char, ecr_instance_t *)); -int ecr_group_broadcast_wait(ecr_group_t, void *, size_t, u_char *); -int ecr_group_atomic_execute(ecr_group_t, void *, size_t, - ecr_instance_t *, - void callback(ecr_instance_t *)); -int ecr_group_atomic_execute_wait(ecr_group_t, void *, size_t); -void ecr_group_success_response(ecr_message_t *); -void ecr_group_failure_response(ecr_message_t *, int); - - - -/* - * Beginning of distributed lock API - */ - -typedef int ecr_lock_t; -typedef enum ecr_lock_mode_s { - ECR_LOCK_START, /* 0th entry is reserved */ - ECR_LOCK_CONCURRENT, /* concurrent access */ - ECR_LOCK_EXCLUSIVE, /* exclusive access */ - ECR_LOCK_LAST /* Just a last enum type, not a lock type */ -} ecr_lock_mode_t; - -typedef u_char ecr_mode_t; - - -#define ECR_LOCKNAME_MAX_SIZE NAME_SIZE /* maximum size of a lock name */ -#define ECR_BLOCK 1 /* waitflag set */ - -ecr_lock_t ecr_lock_create(char * /* lock name */); -int ecr_lock(ecr_lock_t, u64, u64, ecr_lock_mode_t, - u_char /*waitflag*/); -int ecr_unlock(ecr_lock_t, u64, u64); - -#endif /* __EVMS_ECR__ */ diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms_ioctl.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms_ioctl.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms_ioctl.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms_ioctl.h Wed Dec 18 14:51:48 2002 @@ -1,7 +1,5 @@ -/* -*- linux-c -*- */ /* - * - * Copyright (c) International Business Machines Corp., 2000 + * Copyright (c) International Business Machines Corp., 2000 - 2002 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,10 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* - * linux/include/linux/evms.h - * - * EVMS public kernel header file + * EVMS kernel ioctl header file * + * This file contains all information about the ioctl interface. */ #ifndef __EVMS_IOCTL_INCLUDED__ @@ -30,8 +27,8 @@ #include /* IOCTL interface version definitions */ -#define EVMS_IOCTL_INTERFACE_MAJOR 11 -#define EVMS_IOCTL_INTERFACE_MINOR 3 +#define EVMS_IOCTL_INTERFACE_MAJOR 12 +#define EVMS_IOCTL_INTERFACE_MINOR 0 #define EVMS_IOCTL_INTERFACE_PATCHLEVEL 0 /* IOCTL definitions */ @@ -39,7 +36,7 @@ /* version commands */ EVMS_GET_IOCTL_VERSION_NUMBER = 0, EVMS_GET_VERSION_NUMBER, -#ifdef __KERNEL__ + /* EVMS internal commands */ EVMS_GET_DISK_LIST_NUMBER = 0x40, EVMS_CHECK_MEDIA_CHANGE_NUMBER, @@ -49,7 +46,7 @@ EVMS_QUIESCE_VOLUME_NUMBER, EVMS_CHECK_DEVICE_STATUS_NUMBER, EVMS_UPDATE_DEVICE_INFO_NUMBER, -#endif + /* configuration commands */ EVMS_GET_INFO_LEVEL_NUMBER = 0x80, EVMS_SET_INFO_LEVEL_NUMBER, @@ -57,6 +54,7 @@ EVMS_DELETE_VOLUME_NUMBER, EVMS_PLUGIN_IOCTL_NUMBER, EVMS_PROCESS_NOTIFY_EVENT_NUMBER, + /* query info commands */ EVMS_GET_LOGICAL_DISK_NUMBER = 0xC0, EVMS_GET_LOGICAL_DISK_INFO_NUMBER, @@ -68,34 +66,21 @@ EVMS_GET_BMAP_NUMBER, EVMS_CHECK_MOUNT_STATUS_NUMBER, EVMS_CHECK_OPEN_STATUS_NUMBER, + /* commands for non-EVMS apps */ EVMS_GET_VOL_STRIPE_INFO_NUMBER = 0xF0, }; /* version commands */ -#define EVMS_GET_IOCTL_VERSION_STRING "EVMS_GET_IOCTL_VERSION" -#define EVMS_GET_IOCTL_VERSION _IOR(EVMS_MAJOR, EVMS_GET_IOCTL_VERSION_NUMBER, struct evms_version) - -#define EVMS_GET_VERSION_STRING "EVMS_GET_VERSION" -#define EVMS_GET_VERSION _IOR(EVMS_MAJOR, EVMS_GET_VERSION_NUMBER, struct evms_version) - -#ifdef __KERNEL__ +#define EVMS_GET_IOCTL_VERSION _IOR(EVMS_MAJOR, EVMS_GET_IOCTL_VERSION_NUMBER, struct evms_version) +#define EVMS_GET_VERSION _IOR(EVMS_MAJOR, EVMS_GET_VERSION_NUMBER, struct evms_version) /* EVMS internal commands */ -#define EVMS_GET_DISK_LIST_STRING "EVMS_GET_DISK_LIST" -#define EVMS_GET_DISK_LIST _IOWR(EVMS_MAJOR, EVMS_GET_DISK_LIST_NUMBER, struct evms_list_node **) - -#define EVMS_CHECK_MEDIA_CHANGE_STRING "EVMS_CHECK_MEDIA_CHANGE" -#define EVMS_CHECK_MEDIA_CHANGE _IO(EVMS_MAJOR, EVMS_CHECK_MEDIA_CHANGE_NUMBER) - -#define EVMS_REVALIDATE_DISK_STRING "EVMS_REVALIDATE_DISK" -#define EVMS_REVALIDATE_DISK _IO(EVMS_MAJOR, EVMS_REVALIDATE_DISK_NUMBER) - -#define EVMS_OPEN_VOLUME_STRING "EVMS_OPEN_VOLUME" -#define EVMS_OPEN_VOLUME _IO(EVMS_MAJOR, EVMS_OPEN_VOLUME_NUMBER) - -#define EVMS_CLOSE_VOLUME_STRING "EVMS_CLOSE_VOLUME" -#define EVMS_CLOSE_VOLUME _IO(EVMS_MAJOR, EVMS_CLOSE_VOLUME_NUMBER) +#define EVMS_GET_DISK_LIST _IOWR(EVMS_MAJOR, EVMS_GET_DISK_LIST_NUMBER, struct evms_list_node **) +#define EVMS_CHECK_MEDIA_CHANGE _IO(EVMS_MAJOR, EVMS_CHECK_MEDIA_CHANGE_NUMBER) +#define EVMS_REVALIDATE_DISK _IO(EVMS_MAJOR, EVMS_REVALIDATE_DISK_NUMBER) +#define EVMS_OPEN_VOLUME _IO(EVMS_MAJOR, EVMS_OPEN_VOLUME_NUMBER) +#define EVMS_CLOSE_VOLUME _IO(EVMS_MAJOR, EVMS_CLOSE_VOLUME_NUMBER) /** * struct evms_quiesce_vol_pkt - ioctl packet definition @@ -115,30 +100,20 @@ /** * defines for evms_quiesce_vol_pkt.command field **/ -#define EVMS_UNQUIESCE 0 -#define EVMS_QUIESCE 1 +#define EVMS_UNQUIESCE 0 +#define EVMS_QUIESCE 1 /** * defines for evms_quiesce_vol_pkt.do_vfs field * located below struct evms_delete_vol_pkt definition **/ -#define EVMS_QUIESCE_VOLUME_STRING "EVMS_QUIESCE_VOLUME" -#define EVMS_QUIESCE_VOLUME _IOR(EVMS_MAJOR, EVMS_QUIESCE_VOLUME_NUMBER, struct evms_quiesce_vol_pkt) - -#define EVMS_CHECK_DEVICE_STATUS_STRING "EVMS_CHECK_DEVICE_STATUS" -#define EVMS_CHECK_DEVICE_STATUS _IOR(EVMS_MAJOR, EVMS_CHECK_DEVICE_STATUS_NUMBER, int) - -#define EVMS_UPDATE_DEVICE_INFO_STRING "EVMS_UPDATE_DEVICE_INFO" -#define EVMS_UPDATE_DEVICE_INFO _IO(EVMS_MAJOR, EVMS_UPDATE_DEVICE_INFO_NUMBER) - -#endif +#define EVMS_QUIESCE_VOLUME _IOR(EVMS_MAJOR, EVMS_QUIESCE_VOLUME_NUMBER, struct evms_quiesce_vol_pkt) +#define EVMS_CHECK_DEVICE_STATUS _IOR(EVMS_MAJOR, EVMS_CHECK_DEVICE_STATUS_NUMBER, int) +#define EVMS_UPDATE_DEVICE_INFO _IO(EVMS_MAJOR, EVMS_UPDATE_DEVICE_INFO_NUMBER) /* configuration commands */ -#define EVMS_GET_INFO_LEVEL_STRING "EVMS_GET_INFO_LEVEL" -#define EVMS_GET_INFO_LEVEL _IOR(EVMS_MAJOR, EVMS_GET_INFO_LEVEL_NUMBER, int) - -#define EVMS_SET_INFO_LEVEL_STRING "EVMS_SET_INFO_LEVEL" -#define EVMS_SET_INFO_LEVEL _IOW(EVMS_MAJOR, EVMS_SET_INFO_LEVEL_NUMBER, int) +#define EVMS_GET_INFO_LEVEL _IOR(EVMS_MAJOR, EVMS_GET_INFO_LEVEL_NUMBER, int) +#define EVMS_SET_INFO_LEVEL _IOW(EVMS_MAJOR, EVMS_SET_INFO_LEVEL_NUMBER, int) /** * struct evms_rediscover_pkt - rediscover volume ioctl packet definition @@ -156,17 +131,14 @@ /** * defines for evms_delete_vol_pkt.command field **/ -#define EVMS_SOFT_DELETE 0 -#define EVMS_HARD_DELETE 1 +#define EVMS_SOFT_DELETE 0 +#define EVMS_HARD_DELETE 1 /** * defines evms_rediscover_pkt.drive_count field **/ -#define REDISCOVER_ALL_DEVICES 0xFFFFFFFF +#define REDISCOVER_ALL_DEVICES 0xFFFFFFFF -#define EVMS_REDISCOVER_VOLUMES_STRING "EVMS_REDISCOVER_VOLUMES" -#define EVMS_REDISCOVER_VOLUMES _IOWR(EVMS_MAJOR, EVMS_REDISCOVER_VOLUMES_NUMBER, struct evms_rediscover_pkt) - -/* field: command: defines */ +#define EVMS_REDISCOVER_VOLUMES _IOWR(EVMS_MAJOR, EVMS_REDISCOVER_VOLUMES_NUMBER, struct evms_rediscover_pkt) /** * struct evms_delete_vol_pkt - delete volume ioctl packet definition @@ -192,11 +164,10 @@ * * NOTE: these defines are also used with evms_quiesce_vol_pkt. **/ -#define EVMS_VFS_DO_NOTHING 0 -#define EVMS_VFS_DO 1 +#define EVMS_VFS_DO_NOTHING 0 +#define EVMS_VFS_DO 1 -#define EVMS_DELETE_VOLUME_STRING "EVMS_DELETE_VOLUME" -#define EVMS_DELETE_VOLUME _IOR(EVMS_MAJOR, EVMS_DELETE_VOLUME_NUMBER, struct evms_delete_vol_pkt) +#define EVMS_DELETE_VOLUME _IOR(EVMS_MAJOR, EVMS_DELETE_VOLUME_NUMBER, struct evms_delete_vol_pkt) /** * struct evms_plugin_ioctl_pkt - generic plugin ioctl packet definition @@ -208,14 +179,14 @@ * ioctl packet definition for EVMS_PLUGIN_IOCTL ioctl **/ struct evms_plugin_ioctl_pkt { - ulong feature_id; + u32 feature_id; s32 feature_command; s32 status; + u32 data_size; void *feature_ioctl_data; }; -#define EVMS_PLUGIN_IOCTL_STRING "EVMS_PLUGIN_IOCTL" -#define EVMS_PLUGIN_IOCTL _IOR(EVMS_MAJOR, EVMS_PLUGIN_IOCTL_NUMBER, struct evms_plugin_ioctl_pkt) +#define EVMS_PLUGIN_IOCTL _IOR(EVMS_MAJOR, EVMS_PLUGIN_IOCTL_NUMBER, struct evms_plugin_ioctl_pkt) /** * struct evms_event - evms event structure @@ -233,29 +204,28 @@ /** * field evms_event_pkt.eventid defines **/ -#define EVMS_EVENT_END_OF_DISCOVERY 0 +#define EVMS_EVENT_END_OF_DISCOVERY 0 /** * struct evms_notify_pkt - evms event notification ioctl packet definition * @command: 0 = unregister, 1 = register - * @eventry: event structure * @status: returned operation status + * @eventry: event structure * * ioctl packet definition for EVMS_PROCESS_NOTIFY_EVENT ioctl **/ struct evms_notify_pkt { s32 command; - struct evms_event eventry; s32 status; + struct evms_event eventry; }; /** * field evms_notify_pkt.command defines **/ -#define EVMS_EVENT_UNREGISTER 0 -#define EVMS_EVENT_REGISTER 1 +#define EVMS_EVENT_UNREGISTER 0 +#define EVMS_EVENT_REGISTER 1 -#define EVMS_PROCESS_NOTIFY_EVENT_STRING "EVMS_PROCESS_NOTIFY_EVENT" -#define EVMS_PROCESS_NOTIFY_EVENT _IOWR(EVMS_MAJOR, EVMS_PROCESS_NOTIFY_EVENT_NUMBER, struct evms_notify_pkt) +#define EVMS_PROCESS_NOTIFY_EVENT _IOWR(EVMS_MAJOR, EVMS_PROCESS_NOTIFY_EVENT_NUMBER, struct evms_notify_pkt) /* query info commands */ @@ -275,69 +245,69 @@ /** * field evms_user_disk_pkt.command defines **/ -#define EVMS_FIRST_DISK 0 -#define EVMS_NEXT_DISK 1 +#define EVMS_FIRST_DISK 0 +#define EVMS_NEXT_DISK 1 /** * field evms_user_disk_pkt.status defines **/ -#define EVMS_DISK_INVALID 0 -#define EVMS_DISK_VALID 1 +#define EVMS_DISK_INVALID 0 +#define EVMS_DISK_VALID 1 -#define EVMS_GET_LOGICAL_DISK_STRING "EVMS_GET_LOGICAL_DISK" -#define EVMS_GET_LOGICAL_DISK _IOWR(EVMS_MAJOR, EVMS_GET_LOGICAL_DISK_NUMBER, struct evms_user_disk_pkt) +#define EVMS_GET_LOGICAL_DISK _IOWR(EVMS_MAJOR, EVMS_GET_LOGICAL_DISK_NUMBER, struct evms_user_disk_pkt) /** * evms_user_disk_info_pkt - disk info packet definition - * @status: return operation status - * @flags: device characteristics * @disk_handle: kernel handle to specified device + * @total_sectors: size of device in 512 byte units + * @geo_cylinders: device geometry: cylinders + * @geo_sectors: device geometry: sectors + * @geo_heads: device geometry: heads * @disk_dev: kernel device info, used by MD plugin - * @geometry: reported device geometry * @block_size: reported block size * @hardsect_size: reported physical sector size - * @total_vsectors: size of device in 512 byte units + * @status: return operation status + * @flags: device characteristics * @disk_name: legacy name for the device * * ioctl packet definition for EVMS_GET_LOGICAL_DISK_INFO ioctl **/ struct evms_user_disk_info_pkt { - u32 status; - u32 flags; u64 disk_handle; - u32 disk_dev; + u64 total_sectors; + u64 geo_cylinders; u32 geo_sectors; u32 geo_heads; - u64 geo_cylinders; + u32 disk_dev; u32 block_size; u32 hardsect_size; - u64 total_sectors; + u32 status; + u32 flags; u8 disk_name[EVMS_VOLUME_NAME_SIZE + 1]; }; /** * field evms_user_disk_info_pkt.flags define in evms.h **/ -#define EVMS_GET_LOGICAL_DISK_INFO_STRING "EVMS_GET_LOGICAL_DISK_INFO" -#define EVMS_GET_LOGICAL_DISK_INFO _IOWR(EVMS_MAJOR, EVMS_GET_LOGICAL_DISK_INFO_NUMBER, struct evms_user_disk_info_pkt) +#define EVMS_GET_LOGICAL_DISK_INFO _IOWR(EVMS_MAJOR, EVMS_GET_LOGICAL_DISK_INFO_NUMBER, struct evms_user_disk_info_pkt) /** * struct evms_sector_io_pkt - sector io ioctl packet definition * @disk_handle: disk handle of target device - * @io_flag: 0 = read, 1 = write * @starting_sector: disk relative starting sector * @sector_count: count of sectors - * @buffer_address: user buffer address + * @io_flag: 0 = read, 1 = write * @status: return operation status + * @buffer_address: user buffer address * * ioctl packet definition for EVMS_SECTOR_IO ioctl **/ struct evms_sector_io_pkt { u64 disk_handle; - s32 io_flag; u64 starting_sector; u64 sector_count; - u8 *buffer_address; + s32 io_flag; s32 status; + u8 *buffer_address; }; /** * field evms_sector_io_pkt.io_flag defines @@ -345,8 +315,7 @@ #define EVMS_SECTOR_IO_READ 0 #define EVMS_SECTOR_IO_WRITE 1 -#define EVMS_SECTOR_IO_STRING "EVMS_SECTOR_IO" -#define EVMS_SECTOR_IO _IOWR(EVMS_MAJOR, EVMS_SECTOR_IO_NUMBER, struct evms_sector_io_pkt) +#define EVMS_SECTOR_IO _IOWR(EVMS_MAJOR, EVMS_SECTOR_IO_NUMBER, struct evms_sector_io_pkt) /** * struct evms_user_minor_pkt - get a list of device minors, one at a time @@ -364,16 +333,15 @@ /** * field evms_user_minor_pkt.command defines **/ -#define EVMS_FIRST_VOLUME 0 -#define EVMS_NEXT_VOLUME 1 +#define EVMS_FIRST_VOLUME 0 +#define EVMS_NEXT_VOLUME 1 /** * field evms_user_minor_pkt.status defines **/ -#define EVMS_VOLUME_INVALID 0 -#define EVMS_VOLUME_VALID 1 +#define EVMS_VOLUME_INVALID 0 +#define EVMS_VOLUME_VALID 1 -#define EVMS_GET_MINOR_STRING "EVMS_GET_MINOR" -#define EVMS_GET_MINOR _IOWR(EVMS_MAJOR, EVMS_GET_MINOR_NUMBER, struct evms_user_minor_pkt) +#define EVMS_GET_MINOR _IOWR(EVMS_MAJOR, EVMS_GET_MINOR_NUMBER, struct evms_user_minor_pkt) /** * struct evms_volume_data_pkt - volume data packet definition @@ -387,15 +355,14 @@ struct evms_volume_data_pkt { s32 minor; s32 flags; - u8 volume_name[EVMS_VOLUME_NAME_SIZE + 1]; s32 status; + u8 volume_name[EVMS_VOLUME_NAME_SIZE + 1]; }; /** * field evms_volume_data_pkt.flags defines found in evms_common.h **/ -#define EVMS_GET_VOLUME_DATA_STRING "EVMS_GET_VOLUME_DATA" -#define EVMS_GET_VOLUME_DATA _IOWR(EVMS_MAJOR, EVMS_GET_VOLUME_DATA_NUMBER, struct evms_volume_data_pkt) +#define EVMS_GET_VOLUME_DATA _IOWR(EVMS_MAJOR, EVMS_GET_VOLUME_DATA_NUMBER, struct evms_volume_data_pkt) /** * struct evms_kernel_plugin_pkt - get kernel plugin ioctl packet definition @@ -415,16 +382,15 @@ /** * field evms_kernel_plugin_pkt.command defines **/ -#define EVMS_FIRST_PLUGIN 0 -#define EVMS_NEXT_PLUGIN 1 +#define EVMS_FIRST_PLUGIN 0 +#define EVMS_NEXT_PLUGIN 1 /** * field evms_kernel_plugin_pkt.status defines **/ -#define EVMS_PLUGIN_INVALID 0 -#define EVMS_PLUGIN_VALID 1 +#define EVMS_PLUGIN_INVALID 0 +#define EVMS_PLUGIN_VALID 1 -#define EVMS_GET_PLUGIN_STRING "EVMS_GET_PLUGIN" -#define EVMS_GET_PLUGIN _IOWR(EVMS_MAJOR, EVMS_GET_PLUGIN_NUMBER, struct evms_kernel_plugin_pkt) +#define EVMS_GET_PLUGIN _IOWR(EVMS_MAJOR, EVMS_GET_PLUGIN_NUMBER, struct evms_kernel_plugin_pkt) /** * struct evms_compute_csum_pkt - compute checksum ioctl packet definition @@ -444,8 +410,7 @@ s32 status; }; -#define EVMS_COMPUTE_CSUM_STRING "EVMS_COMPUTE_CSUM" -#define EVMS_COMPUTE_CSUM _IOWR(EVMS_MAJOR, EVMS_COMPUTE_CSUM_NUMBER, struct evms_compute_csum_pkt) +#define EVMS_COMPUTE_CSUM _IOWR(EVMS_MAJOR, EVMS_COMPUTE_CSUM_NUMBER, struct evms_compute_csum_pkt) /** * struct evms_get_bmap_pkt - get bmap data ioctl packet definition @@ -462,13 +427,12 @@ s32 status; }; -#define EVMS_GET_BMAP_STRING "EVMS_GET_BMAP" -#define EVMS_GET_BMAP _IOWR(EVMS_MAJOR, EVMS_GET_BMAP_NUMBER, struct evms_get_bmap_pkt) +#define EVMS_GET_BMAP _IOWR(EVMS_MAJOR, EVMS_GET_BMAP_NUMBER, struct evms_get_bmap_pkt) /** * struct evms_mount_status_pkt - ioctl packet definition * @minor: input, minor of volume to check - * @mounted: output, TRUE if mounted, FALSE if not + * @mounted: output, TRUE (1) if mounted, FALSE (0) if not * @status: output, operation completion status * * ioctl packet definition for EVMS_CHECK_MOUNT_STATUS ioctl. @@ -479,8 +443,7 @@ s32 status; }; -#define EVMS_CHECK_MOUNT_STATUS_STRING "EVMS_CHECK_MOUNT_STATUS" -#define EVMS_CHECK_MOUNT_STATUS _IOWR(EVMS_MAJOR, EVMS_CHECK_MOUNT_STATUS_NUMBER, struct evms_mount_status_pkt) +#define EVMS_CHECK_MOUNT_STATUS _IOWR(EVMS_MAJOR, EVMS_CHECK_MOUNT_STATUS_NUMBER, struct evms_mount_status_pkt) /** * struct evms_open_status_pkt - ioctl packet definition @@ -496,8 +459,7 @@ s32 status; }; -#define EVMS_CHECK_OPEN_STATUS_STRING "EVMS_CHECK_OPEN_STATUS" -#define EVMS_CHECK_OPEN_STATUS _IOWR(EVMS_MAJOR, EVMS_CHECK_OPEN_STATUS_NUMBER, struct evms_open_status_pkt) +#define EVMS_CHECK_OPEN_STATUS _IOWR(EVMS_MAJOR, EVMS_CHECK_OPEN_STATUS_NUMBER, struct evms_open_status_pkt) /** * struct evms_vol_stripe_info_pkt - ioctl packet definition @@ -511,6 +473,6 @@ u32 width; }; -#define EVMS_GET_VOL_STRIPE_INFO_STRING "EVMS_GET_VOL_STRIPE_INFO" #define EVMS_GET_VOL_STRIPE_INFO _IOR(EVMS_MAJOR, EVMS_GET_VOL_STRIPE_INFO_NUMBER, struct evms_vol_stripe_info_pkt) #endif + diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms_lvm.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms_lvm.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms_lvm.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms_lvm.h Wed Dec 18 14:51:48 2002 @@ -27,7 +27,7 @@ #define EVMS_LVM_VERSION_MAJOR 1 #define EVMS_LVM_VERSION_MINOR 1 -#define EVMS_LVM_VERSION_PATCH 1 +#define EVMS_LVM_VERSION_PATCH 2 /* The following definitions and data structures are copied from lvm.h and * liblvm.h from the LVM 0.9.1beta8 distribution. Since the metadata format @@ -438,6 +438,7 @@ * @pv_list: List of PVs that make up this group * @volume_list: Array of volumes * @lv_array: Array of LV metadata + * @lv_array_disk: * @uuid_list: List of PV UUIDs * @vg_uuid: UUID from the VG metadata * @vg_name: Name from the PV metadata @@ -455,6 +456,7 @@ struct lvm_physical_volume * pv_list; struct lvm_logical_volume * volume_list[MAX_LV + 1]; struct lv_disk * lv_array; + struct lv_disk * lv_array_disk; u8 * uuid_list; u8 vg_uuid[UUID_LEN]; u8 vg_name[NAME_LEN]; diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms_md.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms_md.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms_md.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms_md.h Wed Dec 18 14:51:48 2002 @@ -67,7 +67,7 @@ */ #define EVMS_MD_MAJOR_VERSION 1 #define EVMS_MD_MINOR_VERSION 1 -#define EVMS_MD_PATCHLEVEL_VERSION 1 +#define EVMS_MD_PATCHLEVEL_VERSION 2 #define MD_MAJOR_VERSION 0 #define MD_MINOR_VERSION 90 diff -Naur linux-2.4.19-evms-1.2.0/include/linux/evms/evms_snapshot.h linux-2.4.19-evms-1.2.1/include/linux/evms/evms_snapshot.h --- linux-2.4.19-evms-1.2.0/include/linux/evms/evms_snapshot.h Wed Dec 18 14:49:09 2002 +++ linux-2.4.19-evms-1.2.1/include/linux/evms/evms_snapshot.h Wed Dec 18 14:51:48 2002 @@ -27,7 +27,7 @@ #define EVMS_SNAPSHOT_VERSION_MAJOR 2 #define EVMS_SNAPSHOT_VERSION_MINOR 1 -#define EVMS_SNAPSHOT_VERSION_PATCHLEVEL 1 +#define EVMS_SNAPSHOT_VERSION_PATCHLEVEL 2 #define EVMS_SNAPSHOT_FEATURE_ID 104