"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "drivers/infiniband/core/uverbs_main.c" between
linux-5.4.19.tar.xz and linux-5.4.20.tar.xz

About: The full source of the Linux kernel 5.4.x (st stable)

uverbs_main.c  (linux-5.4.19.tar.xz):uverbs_main.c  (linux-5.4.20.tar.xz)
skipping to change at line 223 skipping to change at line 223
put_device(&file->device->dev); put_device(&file->device->dev);
if (file->disassociate_page) if (file->disassociate_page)
__free_pages(file->disassociate_page, 0); __free_pages(file->disassociate_page, 0);
mutex_destroy(&file->umap_lock); mutex_destroy(&file->umap_lock);
mutex_destroy(&file->ucontext_lock); mutex_destroy(&file->ucontext_lock);
kfree(file); kfree(file);
} }
static ssize_t ib_uverbs_event_read(struct ib_uverbs_event_queue *ev_queue, static ssize_t ib_uverbs_event_read(struct ib_uverbs_event_queue *ev_queue,
struct ib_uverbs_file *uverbs_file,
struct file *filp, char __user *buf, struct file *filp, char __user *buf,
size_t count, loff_t *pos, size_t count, loff_t *pos,
size_t eventsz) size_t eventsz)
{ {
struct ib_uverbs_event *event; struct ib_uverbs_event *event;
int ret = 0; int ret = 0;
spin_lock_irq(&ev_queue->lock); spin_lock_irq(&ev_queue->lock);
while (list_empty(&ev_queue->event_list)) { while (list_empty(&ev_queue->event_list)) {
spin_unlock_irq(&ev_queue->lock); spin_unlock_irq(&ev_queue->lock);
if (filp->f_flags & O_NONBLOCK) if (filp->f_flags & O_NONBLOCK)
return -EAGAIN; return -EAGAIN;
if (wait_event_interruptible(ev_queue->poll_wait, if (wait_event_interruptible(ev_queue->poll_wait,
(!list_empty(&ev_queue->event_list) || (!list_empty(&ev_queue->event_list) ||
/* The barriers built into wait_event_interruptible() ev_queue->is_closed)))
* and wake_up() guarentee this will see the null set
* without using RCU
*/
!uverbs_file->device->ib_dev)))
return -ERESTARTSYS; return -ERESTARTSYS;
spin_lock_irq(&ev_queue->lock);
/* If device was disassociated and no event exists set an error * / /* If device was disassociated and no event exists set an error * /
if (list_empty(&ev_queue->event_list) && if (list_empty(&ev_queue->event_list) && ev_queue->is_closed) {
!uverbs_file->device->ib_dev) spin_unlock_irq(&ev_queue->lock);
return -EIO; return -EIO;
}
spin_lock_irq(&ev_queue->lock);
} }
event = list_entry(ev_queue->event_list.next, struct ib_uverbs_event, lis t); event = list_entry(ev_queue->event_list.next, struct ib_uverbs_event, lis t);
if (eventsz > count) { if (eventsz > count) {
ret = -EINVAL; ret = -EINVAL;
event = NULL; event = NULL;
} else { } else {
list_del(ev_queue->event_list.next); list_del(ev_queue->event_list.next);
if (event->counter) { if (event->counter) {
skipping to change at line 288 skipping to change at line 284
kfree(event); kfree(event);
return ret; return ret;
} }
static ssize_t ib_uverbs_async_event_read(struct file *filp, char __user *buf, static ssize_t ib_uverbs_async_event_read(struct file *filp, char __user *buf,
size_t count, loff_t *pos) size_t count, loff_t *pos)
{ {
struct ib_uverbs_async_event_file *file = filp->private_data; struct ib_uverbs_async_event_file *file = filp->private_data;
return ib_uverbs_event_read(&file->ev_queue, file->uverbs_file, filp, return ib_uverbs_event_read(&file->ev_queue, filp, buf, count, pos,
buf, count, pos,
sizeof(struct ib_uverbs_async_event_desc)); sizeof(struct ib_uverbs_async_event_desc));
} }
static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf, static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf,
size_t count, loff_t *pos) size_t count, loff_t *pos)
{ {
struct ib_uverbs_completion_event_file *comp_ev_file = struct ib_uverbs_completion_event_file *comp_ev_file =
filp->private_data; filp->private_data;
return ib_uverbs_event_read(&comp_ev_file->ev_queue, return ib_uverbs_event_read(&comp_ev_file->ev_queue, filp, buf, count,
comp_ev_file->uobj.ufile, filp, pos,
buf, count, pos,
sizeof(struct ib_uverbs_comp_event_desc)); sizeof(struct ib_uverbs_comp_event_desc));
} }
static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue, static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
struct file *filp, struct file *filp,
struct poll_table_struct *wait) struct poll_table_struct *wait)
{ {
__poll_t pollflags = 0; __poll_t pollflags = 0;
poll_wait(filp, &ev_queue->poll_wait, wait); poll_wait(filp, &ev_queue->poll_wait, wait);
skipping to change at line 324 skipping to change at line 318
if (!list_empty(&ev_queue->event_list)) if (!list_empty(&ev_queue->event_list))
pollflags = EPOLLIN | EPOLLRDNORM; pollflags = EPOLLIN | EPOLLRDNORM;
spin_unlock_irq(&ev_queue->lock); spin_unlock_irq(&ev_queue->lock);
return pollflags; return pollflags;
} }
static __poll_t ib_uverbs_async_event_poll(struct file *filp, static __poll_t ib_uverbs_async_event_poll(struct file *filp,
struct poll_table_struct *wait) struct poll_table_struct *wait)
{ {
return ib_uverbs_event_poll(filp->private_data, filp, wait); struct ib_uverbs_async_event_file *file = filp->private_data;
return ib_uverbs_event_poll(&file->ev_queue, filp, wait);
} }
static __poll_t ib_uverbs_comp_event_poll(struct file *filp, static __poll_t ib_uverbs_comp_event_poll(struct file *filp,
struct poll_table_struct *wait) struct poll_table_struct *wait)
{ {
struct ib_uverbs_completion_event_file *comp_ev_file = struct ib_uverbs_completion_event_file *comp_ev_file =
filp->private_data; filp->private_data;
return ib_uverbs_event_poll(&comp_ev_file->ev_queue, filp, wait); return ib_uverbs_event_poll(&comp_ev_file->ev_queue, filp, wait);
} }
static int ib_uverbs_async_event_fasync(int fd, struct file *filp, int on) static int ib_uverbs_async_event_fasync(int fd, struct file *filp, int on)
{ {
struct ib_uverbs_event_queue *ev_queue = filp->private_data; struct ib_uverbs_async_event_file *file = filp->private_data;
return fasync_helper(fd, filp, on, &ev_queue->async_queue); return fasync_helper(fd, filp, on, &file->ev_queue.async_queue);
} }
static int ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on) static int ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on)
{ {
struct ib_uverbs_completion_event_file *comp_ev_file = struct ib_uverbs_completion_event_file *comp_ev_file =
filp->private_data; filp->private_data;
return fasync_helper(fd, filp, on, &comp_ev_file->ev_queue.async_queue); return fasync_helper(fd, filp, on, &comp_ev_file->ev_queue.async_queue);
} }
 End of changes. 10 change blocks. 
18 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)