Skip to content

Commit 6ebce44

Browse files
committed
RDMA/uverbs: Remove is_closed from ib_uverbs_file
This does nothing but indicate if the uverbs_file is in the device's list, use list_del_init instead. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
1 parent 9a59739 commit 6ebce44

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

drivers/infiniband/core/uverbs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ struct ib_uverbs_file {
147147
struct ib_event_handler event_handler;
148148
struct ib_uverbs_async_event_file *async_file;
149149
struct list_head list;
150-
int is_closed;
151150

152151
/*
153152
* To access the uobjects list hw_destroy_rwsem must be held for write

drivers/infiniband/core/uverbs_main.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -905,10 +905,7 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp)
905905
uverbs_destroy_ufile_hw(file, RDMA_REMOVE_CLOSE);
906906

907907
mutex_lock(&file->device->lists_mutex);
908-
if (!file->is_closed) {
909-
list_del(&file->list);
910-
file->is_closed = 1;
911-
}
908+
list_del_init(&file->list);
912909
mutex_unlock(&file->device->lists_mutex);
913910

914911
if (file->async_file)
@@ -1104,8 +1101,7 @@ static void ib_uverbs_free_hw_resources(struct ib_uverbs_device *uverbs_dev,
11041101
while (!list_empty(&uverbs_dev->uverbs_file_list)) {
11051102
file = list_first_entry(&uverbs_dev->uverbs_file_list,
11061103
struct ib_uverbs_file, list);
1107-
file->is_closed = 1;
1108-
list_del(&file->list);
1104+
list_del_init(&file->list);
11091105
kref_get(&file->ref);
11101106

11111107
/* We must release the mutex before going ahead and calling

0 commit comments

Comments
 (0)