lib/sock: Make spdk_sock_flush do real work if sock does not belong to a group.

If the sock belongs to a polling group, we already have the mechanism
to do the write/flush work.

Change-Id: Ic15660717f4e83d873ec9f642ababd7fd9cda5eb
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5442
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ziye Yang 2020-12-05 00:40:56 +08:00 committed by Tomasz Zawadzki
parent 5e65adcc7d
commit 27c2daff1d

View File

@ -451,6 +451,11 @@ spdk_sock_flush(struct spdk_sock *sock)
return -EBADF;
}
/* Sock is in a polling group, so group polling mechanism will work */
if (sock->group_impl != NULL) {
return 0;
}
return sock->net_impl->flush(sock);
}