[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sanlock-devel
Subject:    [sanlock] 01/02: sanlock: remove posix aio code
From:       git () pagure ! io (git repository hosting)
Date:       2018-11-07 21:32:07
Message-ID: 20181107213207.9F69521F09CA () pagure01 ! fedoraproject ! org
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script.

teigland pushed a commit to branch master
in repository sanlock.

commit 3981ad5ce2d9a7984ec452d72c7c964d6448f0e3
Author: David Teigland <teigland@redhat.com>
AuthorDate: Wed Nov 7 14:48:22 2018 -0600

    sanlock: remove posix aio code
    
    This code has never been used.
    
    Keeping the native linux aio code.
---
 src/diskio.c | 108 ++---------------------------------------------------------
 1 file changed, 2 insertions(+), 106 deletions(-)

diff --git a/src/diskio.c b/src/diskio.c
index 83b0b1e..cd24c11 100644
--- a/src/diskio.c
+++ b/src/diskio.c
@@ -24,7 +24,6 @@
 #include <sys/sysmacros.h>
 #include <blkid/blkid.h>
 
-#include <libaio.h> /* linux aio */
 #include <aio.h>    /* posix aio */
 #include <aio.h>    /* posix aio */
 
@@ -679,114 +678,13 @@ static int do_read_aio_linux(int fd, uint64_t offset, char *buf, int len,
 	return do_linux_aio(fd, offset, buf, len, task, ioto, IO_CMD_PREAD, rd_ms);
 }
 
-static int do_write_aio_posix(int fd, uint64_t offset, char *buf, int len,
-			      struct task *task GNUC_UNUSED, int ioto)
-{
-	struct timespec ts;
-	struct aiocb cb;
-	struct aiocb const *p_cb;
-	int rv;
-
-	memset(&ts, 0, sizeof(struct timespec));
-	ts.tv_sec = ioto;
-
-	memset(&cb, 0, sizeof(struct aiocb));
-	p_cb = &cb;
-
-	cb.aio_fildes = fd;
-	cb.aio_buf = buf;
-	cb.aio_nbytes = len;
-	cb.aio_offset = offset;
-
-	rv = aio_write(&cb);
-	if (rv < 0)
-		return -1;
-
-	rv = aio_suspend(&p_cb, 1, &ts);
-	if (!rv)
-		return 0;
-
-	/* the write timed out, try to cancel it... */
-
-	rv = aio_cancel(fd, &cb);
-	if (rv < 0)
-		return -1;
-
-	if (rv == AIO_ALLDONE)
-		return 0;
-
-	if (rv == AIO_CANCELED)
-		return -EIO;
-
-	/* Functions that depend on the timeout might consider
-	 * the action failed even if it will complete if that
-	 * happened after the alloted time frame */
-
-	if (rv == AIO_NOTCANCELED)
-		return -EIO;
-
-	/* undefined error condition */
-	return -1;
-}
-
-static int do_read_aio_posix(int fd, uint64_t offset, char *buf, int len,
-			     struct task *task GNUC_UNUSED, int ioto)
-{
-	struct timespec ts;
-	struct aiocb cb;
-	struct aiocb const *p_cb;
-	int rv;
-
-	memset(&ts, 0, sizeof(struct timespec));
-	ts.tv_sec = ioto;
-
-	memset(&cb, 0, sizeof(struct aiocb));
-	p_cb = &cb;
-
-	cb.aio_fildes = fd;
-	cb.aio_buf = buf;
-	cb.aio_nbytes = len;
-	cb.aio_offset = offset;
-
-	rv = aio_read(&cb);
-	if (rv < 0)
-		return -1;
-
-	rv = aio_suspend(&p_cb, 1, &ts);
-	if (!rv)
-		return 0;
-
-	/* the read timed out, try to cancel it... */
-
-	rv = aio_cancel(fd, &cb);
-	if (rv < 0)
-		return -1;
-
-	if (rv == AIO_ALLDONE)
-		return 0;
-
-	if (rv == AIO_CANCELED)
-		return -EIO;
-
-	if (rv == AIO_NOTCANCELED)
-		/* Functions that depend on the timeout might consider
-		 * the action failed even if it will complete if that
-		 * happened apter the alloted time frame */
-		return -EIO;
-
-	/* undefined error condition */
-	return -1;
-}
-
 /* write aligned io buffer */
 
 int write_iobuf(int fd, uint64_t offset, char *iobuf, int iobuf_len,
 		struct task *task, int ioto, int *wr_ms)
 {
-	if (task && task->use_aio == 1)
+	if (task && task->use_aio)
 		return do_write_aio_linux(fd, offset, iobuf, iobuf_len, task, ioto, wr_ms);
-	else if (task && task->use_aio == 2)
-		return do_write_aio_posix(fd, offset, iobuf, iobuf_len, task, ioto);
 	else
 		return do_write(fd, offset, iobuf, iobuf_len, task);
 }
@@ -884,10 +782,8 @@ int write_sectors(const struct sync_disk *disk, int sector_size, uint64_t sector
 int read_iobuf(int fd, uint64_t offset, char *iobuf, int iobuf_len,
 	       struct task *task, int ioto, int *rd_ms)
 {
-	if (task && task->use_aio == 1)
+	if (task && task->use_aio)
 		return do_read_aio_linux(fd, offset, iobuf, iobuf_len, task, ioto, rd_ms);
-	else if (task && task->use_aio == 2)
-		return do_read_aio_posix(fd, offset, iobuf, iobuf_len, task, ioto);
 	else
 		return do_read(fd, offset, iobuf, iobuf_len, task);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
sanlock-devel mailing list -- sanlock-devel@lists.fedorahosted.org
To unsubscribe send an email to sanlock-devel-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/sanlock-devel@lists.fedorahosted.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic