src/direct_lib.c | 18 ------------------
src/sanlock_direct.h | 6 ------
tests/devcount.c | 14 +-------------
3 files changed, 1 insertion(+), 37 deletions(-)
New commits:
commit f72071848ad54e9450e78bde9e5ea935b19d85f7
Author: David Teigland <teigland(a)redhat.com>
Date: Tue Jun 14 16:17:00 2011 -0500
sanlock: remove sector_size api
I can't think of a case where this should really be used.
The align api should be used to determine proper offsets.
diff --git a/src/direct_lib.c b/src/direct_lib.c
index fa26736..e31e514 100644
--- a/src/direct_lib.c
+++ b/src/direct_lib.c
@@ -111,24 +111,6 @@ int sanlock_direct_init(struct sanlk_lockspace *ls,
return rv;
}
-int sanlock_direct_sector_size(struct sanlk_disk *disk_in)
-{
- struct sync_disk disk;
- int rv;
-
- memset(&disk, 0, sizeof(disk));
-
- memcpy(disk.path, disk_in->path, SANLK_PATH_LEN);
-
- rv = open_disk(&disk);
- if (rv < 0)
- return rv;
-
- close(disk.fd);
-
- return disk.sector_size;
-}
-
int sanlock_direct_align(struct sanlk_disk *disk_in)
{
struct sync_disk disk;
diff --git a/src/sanlock_direct.h b/src/sanlock_direct.h
index d0976f6..83f1522 100644
--- a/src/sanlock_direct.h
+++ b/src/sanlock_direct.h
@@ -39,12 +39,6 @@ int sanlock_direct_init(struct sanlk_lockspace *ls,
int max_hosts, int num_hosts, int use_aio);
/*
- * Returns sector size in bytes, -1 on error
- */
-
-int sanlock_direct_sector_size(struct sanlk_disk *disk);
-
-/*
* Returns the alignment in bytes required by sanlock_direct_init()
* (1MB for disks with 512 sectors, 8MB for disks with 4096 sectors)
*/
diff --git a/tests/devcount.c b/tests/devcount.c
index ee9a9dd..67ce943 100644
--- a/tests/devcount.c
+++ b/tests/devcount.c
@@ -1358,7 +1358,7 @@ int do_init(int argc, char *argv[])
struct sanlk_resource *res;
struct sanlk_lockspace ls;
char command[4096];
- int rv, ss, align_size;
+ int rv, align_size;
if (argc < 4)
return -1;
@@ -1397,13 +1397,6 @@ int do_init(int argc, char *argv[])
memset(&disk, 0, sizeof(disk));
strcpy(disk.path, argv[2]);
- ss = sanlock_direct_sector_size(&disk);
- if (ss < 0) {
- printf("sanlock_direct_sector_size %s error %d\n",
- disk.path, ss);
- return -1;
- }
-
align_size = sanlock_direct_align(&disk);
if (align_size != LEASE_SIZE) {
printf("sanlock_direct align %s error %d\n",
@@ -1411,11 +1404,6 @@ int do_init(int argc, char *argv[])
return -1;
}
- if (ss != 512) {
- printf("unsupported sector size %d\n", ss);
- return -1;
- }
-
memset(&ls, 0, sizeof(ls));
strcpy(ls.name, "devcount");
strcpy(ls.host_id_disk.path, argv[2]);
Show replies by thread