Add support for setting blocking and non-blocking mode on /dev/rdma_cm

by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by:	Alex Bowden <alex.bowden@outlook.com>
Sponsored by:	Mellanox Technologies
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2016-08-18 08:49:02 +00:00
parent 9ab0e2a7e0
commit 7dc445f8d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304342

View File

@ -42,6 +42,8 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <sys/filio.h>
#include <rdma/rdma_user_cm.h>
#include <rdma/ib_marshall.h>
#include <rdma/rdma_cm.h>
@ -1345,11 +1347,25 @@ static int ucma_close(struct inode *inode, struct file *filp)
return 0;
}
static long
ucma_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case FIONBIO:
case FIOASYNC:
return (0);
default:
return (-ENOTTY);
}
}
static const struct file_operations ucma_fops = {
.owner = THIS_MODULE,
.open = ucma_open,
.release = ucma_close,
.write = ucma_write,
.unlocked_ioctl = ucma_ioctl,
.poll = ucma_poll,
.llseek = no_llseek,
};