[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-101-g2616afb
Mike Christie
michaelc at cs.wisc.edu
Mon May 2 18:56:30 UTC 2011
The following commit has been merged in the upstream-mnc branch:
commit 6b70c60da105cf5d9ccf03cce131cdc3600e653c
Author: Mike Christie <michaelc at cs.wisc.edu>
Date: Sat Jan 29 23:36:17 2011 -0600
iscsid: modify data drop
When droppng data there is not need to copy to a buffer.
We can just leave it in the recv buf and overwrite it since
it will not be used.
diff --git a/usr/netlink.c b/usr/netlink.c
index e70602d..c5d8650 100644
--- a/usr/netlink.c
+++ b/usr/netlink.c
@@ -143,7 +143,8 @@ nlpayload_read(int ctrl_fd, char *data, int count, int flags)
*/
rc = recvmsg(ctrl_fd, &msg, flags);
- memcpy(data, NLMSG_DATA(iov.iov_base), count);
+ if (data)
+ memcpy(data, NLMSG_DATA(iov.iov_base), count);
return rc;
}
@@ -908,23 +909,10 @@ kget_stats(uint64_t transport_handle, uint32_t sid, uint32_t cid,
static void drop_data(struct nlmsghdr *nlh)
{
- int ev_size, read, curr_total;
-
- curr_total = nlh->nlmsg_len - NLMSG_ALIGN(sizeof(struct nlmsghdr));
- while (curr_total > 0) {
- ev_size = curr_total;
- if (ev_size > NLM_BUF_DEFAULT_MAX)
- ev_size = NLM_BUF_DEFAULT_MAX;
-
- /* sendbuf will not be used here, so dump data to it */
- read = nlpayload_read(ctrl_fd, nlm_sendbuf, ev_size, 0);
- if (read < 0) {
- log_error("Could not drop %d bytes of data.\n",
- read);
- } else if (!read)
- break;
- curr_total -= read;
- }
+ int ev_size;
+
+ ev_size = nlh->nlmsg_len - NLMSG_ALIGN(sizeof(struct nlmsghdr));
+ nlpayload_read(ctrl_fd, NULL, ev_size, 0);
}
static int ctldev_handle(void)
--
Debian Open-iSCSI Packaging
More information about the Pkg-iscsi-maintainers
mailing list