Code clean ups for 4.8
Subsystems (2)
cover Code clean ups for 4.8
From: Ira Weiny <[email protected]>
The following patches perform some code clean up in preparation for up coming fixes.
Functionality is not changed.
Dean Luick (6):
IB/hfi1: Remove unused uctxt->subpid and uctxt->pid IB/hfi1: Remove unused function hfi1_mmu_rb_search IB/hfi1: Always expect ops functions
IB/hfi1: Make iovec loop index easy to understand IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister() IB/hfi1: Rename TID mmu_rb_* functions
Ira Weiny (7):
IB/hfi1: Fix minor format error
IB/hfi1: Add parameter names to function declarations IB/hfi1: Add parameter names to callback declarations IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove IB/hfi1: Remove unused sub-context parameter IB/hfi1: Use "false" not 0
IB/hfi1: Restructure hfi1_file_open
drivers/infiniband/hw/hfi1/file_ops.c | 18 ++++---- drivers/infiniband/hw/hfi1/hfi.h | 11 +++-- drivers/infiniband/hw/hfi1/mmu_rb.c | 74 ++++++++----------------------- drivers/infiniband/hw/hfi1/mmu_rb.h | 13 +++--- drivers/infiniband/hw/hfi1/user_exp_rcv.c | 33 +++++++------- drivers/infiniband/hw/hfi1/user_sdma.c | 11 ++--- 6 files changed, 62 insertions(+), 98 deletions(-)
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/13 IB/hfi1: Fix minor format error
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
Brackets should be on the next line of a function
--- drivers/infiniband/hw/hfi1/user_sdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/user_sdma.c +2 -1
@@ -1115,7 +1115,8 @@ static u32 sdma_cache_evict(struct hfi1_user_sdma_pkt_q *pq, u32 npages) }static int pin_vector_pages (struct user_sdma_request *req, -struct user_sdma_iovec *iovec) { +struct user_sdma_iovec *iovec) +{int ret =0 , pinned, npages, cleared;struct page **pages;struct hfi1_user_sdma_pkt_q *pq = req->pq;
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/13 IB/hfi1: Remove unused uctxt->subpid and uctxt->pid
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
These are no longer needed.
--- drivers/infiniband/hw/hfi1/file_ops.c | 4 ---- drivers/infiniband/hw/hfi1/hfi.h | 3 --- 2 files changed, 7 deletions(-)
drivers/infiniband/hw/hfi1/file_ops.c +0 -4
@@ -727,7 +727,6 @@ static int hfi1_file_close(struct inode *inode, struct file *fp)if (--uctxt->cnt) { uctxt->active_slaves &= ~(1 << fdata->subctxt); - uctxt->subpid[fdata->subctxt] =0 ;mutex_unlock (&hfi1_mutex); goto done; }
@@ -753,7 +752,6 @@ static int hfi1_file_close(struct inode *inode, struct file *fp)write_kctxt_csr (dd, uctxt->sc->hw_context,SEND_CTXT_CHECK_ENABLE ,hfi1_pkt_default_send_ctxt_mask (dd, uctxt->sc->type));sc_disable (uctxt->sc); - uctxt->pid =0 ;spin_unlock_irqrestore (&dd->uctxt_lock, flags); dd->rcd[uctxt->ctxt] =NULL ;
@@ -893,7 +891,6 @@ static int find_shared_ctxt(struct file *fp, } fd->uctxt = uctxt; fd->subctxt = uctxt->cnt++; - uctxt->subpid[fd->subctxt] = current->pid; uctxt->active_slaves |=1 << fd->subctxt; ret =1 ; goto done;
@@ -978,7 +975,6 @@ static int allocate_ctxt(struct file *fp, struct hfi1_devdata *dd,return ret; } uctxt->userversion = uinfo->userversion; - uctxt->pid = current->pid; uctxt->flags =HFI1_CAP_UGET (MASK );init_waitqueue_head (&uctxt->wait);strlcpy (uctxt->comm, current->comm,sizeof (uctxt->comm));
drivers/infiniband/hw/hfi1/hfi.h +0 -3
@@ -270,9 +270,6 @@ struct hfi1_ctxtdata {u32 urgent;/* saved total number of polled urgent packets for poll edge trigger */ u32 urgent_poll; -/* pid of process using this ctxt */ -pid_t pid; -pid_t subpid[HFI1_MAX_SHARED_CTXTS ];/* same size as task_struct .comm[], command that opened context */ char comm[TASK_COMM_LEN ];/* so file ops can get at unit */
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/13 IB/hfi1: Remove unused function hfi1_mmu_rb_search
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
--- drivers/infiniband/hw/hfi1/mmu_rb.c | 17 ----------------- drivers/infiniband/hw/hfi1/mmu_rb.h | 2 -- 2 files changed, 19 deletions(-)
drivers/infiniband/hw/hfi1/mmu_rb.c +0 -17
@@ -223,23 +223,6 @@ static void __mmu_rb_remove(struct mmu_rb_handler *handler, handler->ops->remove (handler->root, node, mm); } -struct mmu_rb_node *hfi1_mmu_rb_search (struct rb_root *root,unsigned long addr, -unsigned long len) -{ -struct mmu_rb_handler *handler =find_mmu_handler (root); -struct mmu_rb_node *node; -unsigned long flags; - -if (!handler) -return ERR_PTR (-EINVAL ); - -spin_lock_irqsave (&handler->lock, flags); - node =__mmu_rb_search (handler, addr, len); -spin_unlock_irqrestore (&handler->lock, flags); - -return node; -} -struct mmu_rb_node *hfi1_mmu_rb_extract (struct rb_root *root,unsigned long addr,unsigned long len) {
drivers/infiniband/hw/hfi1/mmu_rb.h +0 -2
@@ -68,8 +68,6 @@ int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops);void hfi1_mmu_rb_unregister (struct rb_root *);int hfi1_mmu_rb_insert (struct rb_root *,struct mmu_rb_node *);void hfi1_mmu_rb_remove (struct rb_root *,struct mmu_rb_node *); -struct mmu_rb_node *hfi1_mmu_rb_search (struct rb_root *,unsigned long , -unsigned long );struct mmu_rb_node *hfi1_mmu_rb_extract (struct rb_root *,unsigned long ,unsigned long );
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/13 IB/hfi1: Add parameter names to function declarations
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
Parameter names to function declarations make it more clear what those parameters do.
--- drivers/infiniband/hw/hfi1/hfi.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hfi1/hfi.h +5 -3
@@ -1700,9 +1700,11 @@ void shutdown_led_override(struct hfi1_pportdata *ppd);*/ #define DEFAULT_RCVHDR_ENTSIZE 32 -bool hfi1_can_pin_pages (struct hfi1_devdata *,u32 ,u32 ); -int hfi1_acquire_user_pages (unsigned long ,size_t ,bool ,struct page **); -void hfi1_release_user_pages (struct mm_struct *,struct page **,size_t ,bool ); +bool hfi1_can_pin_pages (struct hfi1_devdata *dd,u32 nlocked,u32 npages); +int hfi1_acquire_user_pages (unsigned long vaddr,size_t npages,bool writable, +struct page **pages); +void hfi1_release_user_pages (struct mm_struct *mm,struct page **p, +size_t npages,bool dirty);static inline void clear_rcvhdrtail (const struct hfi1_ctxtdata *rcd) {
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/13 IB/hfi1: Add parameter names to callback declarations
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
This makes it more clear what these functions are
operating on.
--- drivers/infiniband/hw/hfi1/mmu_rb.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/infiniband/hw/hfi1/mmu_rb.h +6 -5
@@ -57,11 +57,12 @@ struct mmu_rb_node { };struct mmu_rb_ops { -bool (*filter)(struct mmu_rb_node *,unsigned long ,unsigned long ); -int (*insert)(struct rb_root *,struct mmu_rb_node *); -void (*remove)(struct rb_root *,struct mmu_rb_node *, -struct mm_struct *); -int (*invalidate)(struct rb_root *,struct mmu_rb_node *); +bool (*filter)(struct mmu_rb_node *node,unsigned long addr, +unsigned long len); +int (*insert)(struct rb_root *root,struct mmu_rb_node *mnode); +void (*remove)(struct rb_root *root,struct mmu_rb_node *mnode, +struct mm_struct *mm); +int (*invalidate)(struct rb_root *root,struct mmu_rb_node *node); };int hfi1_mmu_rb_register (struct rb_root *root,struct mmu_rb_ops *ops);
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/13 IB/hfi1: Always expect ops functions
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
Remove, insert, and invalidate are always provided. No need to test.
--- drivers/infiniband/hw/hfi1/mmu_rb.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
drivers/infiniband/hw/hfi1/mmu_rb.c +6 -14
@@ -99,9 +99,6 @@ int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops) {struct mmu_rb_handler *handlr; -if (!ops->invalidate) -return -EINVAL ; - handlr =kmalloc (sizeof (*handlr),GFP_KERNEL );if (!handlr)return -ENOMEM ;
@@ -143,8 +140,7 @@ void hfi1_mmu_rb_unregister(struct rb_root *root)while ((node =rb_first (root))) { rbnode = rb_entry(node, struct mmu_rb_node, node);rb_erase (node, root); -if (handler->ops->remove) - handler->ops->remove (root, rbnode,NULL ); + handler->ops->remove (root, rbnode,NULL ); } }spin_unlock_irqrestore (&handler->lock, flags);
@@ -172,11 +168,9 @@ int hfi1_mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *mnode) }__mmu_int_rb_insert (mnode, root); -if (handler->ops->insert) { - ret = handler->ops->insert (root, mnode); -if (ret) -__mmu_int_rb_remove (mnode, root); - } + ret = handler->ops->insert (root, mnode); +if (ret) +__mmu_int_rb_remove (mnode, root); unlock:spin_unlock_irqrestore (&handler->lock, flags);return ret;
@@ -219,8 +213,7 @@ static void __mmu_rb_remove(struct mmu_rb_handler *handler,__mmu_int_rb_remove (node, handler->root);spin_unlock_irqrestore (&handler->lock, flags); -if (handler->ops->remove) - handler->ops->remove (handler->root, node, mm); + handler->ops->remove (handler->root, node, mm); } struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,
@@ -300,8 +293,7 @@ static void mmu_notifier_mem_invalidate(struct mmu_notifier *mn, node->addr, node->len);if (handler->ops->invalidate (root, node)) {__mmu_int_rb_remove (node, root); -if (handler->ops->remove) - handler->ops->remove (root, node, mm); + handler->ops->remove (root, node, mm); } }spin_unlock_irqrestore (&handler->lock, flags);
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/13 IB/hfi1: Consolidate __mmu_rb_remove and hfi1_mmu_rb_remove
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
__mmu_rb_remove was called in only 1 place which was a very simple call site. Combine this function into its caller.
--- drivers/infiniband/hw/hfi1/mmu_rb.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-)
drivers/infiniband/hw/hfi1/mmu_rb.c +9 -17
@@ -200,22 +200,6 @@ static struct mmu_rb_node *__mmu_rb_search(struct mmu_rb_handler *handler,return node; } -/* Caller must *not* hold handler lock. */ -static void __mmu_rb_remove (struct mmu_rb_handler *handler, -struct mmu_rb_node *node,struct mm_struct *mm) -{ -unsigned long flags; - -/* Validity of handler and node pointers has been checked by caller. */ -hfi1_cdbg (MMU ,"Removing node addr 0x%llx, len %u" , node->addr, - node->len); -spin_lock_irqsave (&handler->lock, flags); -__mmu_int_rb_remove (node, handler->root); -spin_unlock_irqrestore (&handler->lock, flags); - - handler->ops->remove (handler->root, node, mm); -} -struct mmu_rb_node *hfi1_mmu_rb_extract (struct rb_root *root,unsigned long addr,unsigned long len) {
@@ -237,12 +221,20 @@ struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,void hfi1_mmu_rb_remove (struct rb_root *root,struct mmu_rb_node *node) { +unsigned long flags;struct mmu_rb_handler *handler =find_mmu_handler (root);if (!handler || !node)return ; -__mmu_rb_remove (handler, node,NULL ); +/* Validity of handler and node pointers has been checked by caller. */ +hfi1_cdbg (MMU ,"Removing node addr 0x%llx, len %u" , node->addr, + node->len); +spin_lock_irqsave (&handler->lock, flags); +__mmu_int_rb_remove (node, handler->root); +spin_unlock_irqrestore (&handler->lock, flags); + + handler->ops->remove (handler->root, node,NULL ); }static struct mmu_rb_handler *find_mmu_handler (struct rb_root *root)
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/13 IB/hfi1: Remove unused sub-context parameter
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
subctxt is not used, just remove it.
--- drivers/infiniband/hw/hfi1/user_exp_rcv.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/infiniband/hw/hfi1/user_exp_rcv.c +4 -5
@@ -94,7 +94,7 @@ static int program_rcvarray(struct file *, unsigned long, struct tid_group *, struct tid_pageset *, unsigned, u16, struct page **, u32 *, unsigned *, unsigned *);static int unprogram_rcvarray (struct file *,u32 ,struct tid_group **); -static void clear_tid_node (struct hfi1_filedata *,u16 ,struct tid_rb_node *); +static void clear_tid_node (struct hfi1_filedata *,struct tid_rb_node *);static struct mmu_rb_ops tid_rb_ops = { .insert = mmu_rb_insert,
@@ -911,12 +911,11 @@ static int unprogram_rcvarray(struct file *fp, u32 tidinfo,if (grp) *grp = node->grp; -clear_tid_node (fd, fd->subctxt, node); +clear_tid_node (fd, node);return 0 ; } -static void clear_tid_node (struct hfi1_filedata *fd,u16 subctxt, -struct tid_rb_node *node) +static void clear_tid_node (struct hfi1_filedata *fd,struct tid_rb_node *node) {struct hfi1_ctxtdata *uctxt = fd->uctxt;struct hfi1_devdata *dd = uctxt->dd;
@@ -975,7 +974,7 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt,else hfi1_mmu_rb_remove (&fd->tid_rb_root, &node->mmu); -clear_tid_node (fd,-1 , node); +clear_tid_node (fd, node); } } }
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/13 IB/hfi1: Use "false" not 0
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
For bool parameters "false" should be used
--- drivers/infiniband/hw/hfi1/user_sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/user_sdma.c +1 -1
@@ -1224,7 +1224,7 @@ bail:static void unpin_vector_pages (struct mm_struct *mm,struct page **pages,unsigned start,unsigned npages) { -hfi1_release_user_pages (mm, pages + start, npages,0 ); +hfi1_release_user_pages (mm, pages + start, npages, false);kfree (pages); }
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/13 IB/hfi1: Make iovec loop index easy to understand
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
--- drivers/infiniband/hw/hfi1/user_sdma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hfi1/user_sdma.c +3 -3
@@ -520,7 +520,7 @@ static u8 dlid_to_selector(u16 dlid)int hfi1_user_sdma_process_request (struct file *fp,struct iovec *iovec,unsigned long dim,unsigned long *count) { -int ret =0 , i =0 ; +int ret =0 , i;struct hfi1_filedata *fd = fp->private_data;struct hfi1_ctxtdata *uctxt = fd->uctxt;struct hfi1_user_sdma_pkt_q *pq = fd->pq;
@@ -657,7 +657,7 @@ int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec, idx++;/* Save all the IO vector structures */ -while (i < req->data_iovs) { +for (i =0 ; i < req->data_iovs; i++) {INIT_LIST_HEAD (&req->iovs[i].list);memcpy (&req->iovs[i].iov, iovec + idx++,sizeof (struct iovec )); ret =pin_vector_pages (req, &req->iovs[i]);
@@ -665,7 +665,7 @@ int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec, req->status = ret; goto free_req; } - req->data_len += req->iovs[i++].iov.iov_len; + req->data_len += req->iovs[i].iov.iov_len; }SDMA_DBG (req,"total data length %u" , req->data_len);
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 11/13 IB/hfi1: Restructure hfi1_file_open
In reply to a message not in the archiveFrom: Ira Weiny <[email protected]>
Rearrange the file open call in prep for new changes.
--- drivers/infiniband/hw/hfi1/file_ops.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/file_ops.c +10 -4
@@ -168,6 +168,7 @@ static inline int is_valid_mmap(u64 token)static int hfi1_file_open (struct inode *inode,struct file *fp) { +struct hfi1_filedata *fd;struct hfi1_devdata *dd =container_of (inode->i_cdev, struct hfi1_devdata, user_cdev);
@@ -176,10 +177,15 @@ static int hfi1_file_open(struct inode *inode, struct file *fp)kobject_get (&dd->kobj);/* The real work is performed later in assign_ctxt() */ - fp->private_data =kzalloc (sizeof (struct hfi1_filedata ),GFP_KERNEL ); -if (fp->private_data)/* no cpu affinity by default */ - ((struct hfi1_filedata *)fp->private_data)->rec_cpu_num =-1 ; -return fp->private_data ?0 : -ENOMEM ; + + fd =kzalloc (sizeof (*fd),GFP_KERNEL ); + +if (fd)/* no cpu affinity by default */ + fd->rec_cpu_num =-1 ; + + fp->private_data = fd; + +return fd ?0 : -ENOMEM ; } static long hfi1_file_ioctl(struct file *fp, unsigned int cmd,
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/13 IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister()
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
Checking if the rb tree is empty is redundant with the while loop which is emptying the rb tree.
--- drivers/infiniband/hw/hfi1/mmu_rb.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/infiniband/hw/hfi1/mmu_rb.c +6 -9
@@ -118,6 +118,8 @@ int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops)void hfi1_mmu_rb_unregister (struct rb_root *root) {struct mmu_rb_handler *handler =find_mmu_handler (root); +struct mmu_rb_node *rbnode; +struct rb_node *node;unsigned long flags;if (!handler)
@@ -133,15 +135,10 @@ void hfi1_mmu_rb_unregister(struct rb_root *root)synchronize_rcu ();spin_lock_irqsave (&handler->lock, flags); -if (!RB_EMPTY_ROOT (root)) { -struct rb_node *node; -struct mmu_rb_node *rbnode; - -while ((node =rb_first (root))) { - rbnode = rb_entry(node, struct mmu_rb_node, node); -rb_erase (node, root); - handler->ops->remove (root, rbnode,NULL ); - } +while ((node =rb_first (root))) { + rbnode = rb_entry(node, struct mmu_rb_node, node); +rb_erase (node, root); + handler->ops->remove (root, rbnode,NULL ); }spin_unlock_irqrestore (&handler->lock, flags);
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/13 IB/hfi1: Rename TID mmu_rb_* functions
In reply to a message not in the archiveFrom: Dean Luick <[email protected]>
Clarify the names of the TID mmu functions.
--- drivers/infiniband/hw/hfi1/user_exp_rcv.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/infiniband/hw/hfi1/user_exp_rcv.c +12 -12
@@ -86,10 +86,10 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *, struct exp_tid_set *,static u32 find_phys_blocks (struct page **,unsigned ,struct tid_pageset *);static int set_rcvarray_entry (struct file *,unsigned long ,u32 ,struct tid_group *,struct page **,unsigned ); -static int mmu_rb_insert (struct rb_root *,struct mmu_rb_node *); -static void mmu_rb_remove (struct rb_root *,struct mmu_rb_node *, +static int tid_rb_insert (struct rb_root *,struct mmu_rb_node *); +static void tid_rb_remove (struct rb_root *,struct mmu_rb_node *,struct mm_struct *); -static int mmu_rb_invalidate (struct rb_root *,struct mmu_rb_node *); +static int tid_rb_invalidate (struct rb_root *,struct mmu_rb_node *);static int program_rcvarray (struct file *,unsigned long ,struct tid_group *,struct tid_pageset *,unsigned ,u16 ,struct page **,u32 *,unsigned *,unsigned *);
@@ -97,9 +97,9 @@ static int unprogram_rcvarray(struct file *, u32, struct tid_group **);static void clear_tid_node (struct hfi1_filedata *,struct tid_rb_node *);static struct mmu_rb_ops tid_rb_ops = { - .insert = mmu_rb_insert, - .remove = mmu_rb_remove, - .invalidate = mmu_rb_invalidate + .insert = tid_rb_insert, + .remove = tid_rb_remove, + .invalidate = tid_rb_invalidate };static inline u32 rcventry2tidinfo (u32 rcventry)
@@ -862,7 +862,7 @@ static int set_rcvarray_entry(struct file *fp, unsigned long vaddr,memcpy (node->pages, pages,sizeof (struct page *) * npages);if (HFI1_CAP_IS_USET (TID_UNMAP )) - ret =mmu_rb_insert (root, &node->mmu); + ret =tid_rb_insert (root, &node->mmu);else ret =hfi1_mmu_rb_insert (root, &node->mmu);
@@ -905,7 +905,7 @@ static int unprogram_rcvarray(struct file *fp, u32 tidinfo,if (!node || node->rcventry != (uctxt->expected_base + rcventry))return -EBADF ;if (HFI1_CAP_IS_USET (TID_UNMAP )) -mmu_rb_remove (&fd->tid_rb_root, &node->mmu,NULL ); +tid_rb_remove (&fd->tid_rb_root, &node->mmu,NULL );else hfi1_mmu_rb_remove (&fd->tid_rb_root, &node->mmu);
@@ -969,7 +969,7 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt,if (!node || node->rcventry != rcventry)continue ;if (HFI1_CAP_IS_USET (TID_UNMAP )) -mmu_rb_remove (&fd->tid_rb_root, +tid_rb_remove (&fd->tid_rb_root, &node->mmu,NULL );else hfi1_mmu_rb_remove(&fd->tid_rb_root,
@@ -980,7 +980,7 @@ static void unlock_exp_tids(struct hfi1_ctxtdata *uctxt, } } -static int mmu_rb_invalidate (struct rb_root *root,struct mmu_rb_node *mnode) +static int tid_rb_invalidate (struct rb_root *root,struct mmu_rb_node *mnode) {struct hfi1_filedata *fdata = container_of(root, struct hfi1_filedata, tid_rb_root);
@@ -1024,7 +1024,7 @@ static int mmu_rb_invalidate(struct rb_root *root, struct mmu_rb_node *mnode)return 0 ; } -static int mmu_rb_insert (struct rb_root *root,struct mmu_rb_node *node) +static int tid_rb_insert (struct rb_root *root,struct mmu_rb_node *node) {struct hfi1_filedata *fdata = container_of(root, struct hfi1_filedata, tid_rb_root);
@@ -1036,7 +1036,7 @@ static int mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *node)return 0 ; } -static void mmu_rb_remove (struct rb_root *root,struct mmu_rb_node *node, +static void tid_rb_remove (struct rb_root *root,struct mmu_rb_node *node,struct mm_struct *mm) { struct hfi1_filedata *fdata =
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 25 lines · On Thu, 2016-07-28 at 12:27 -0400, [email protected]…
From: Ira Weiny <[email protected]>
The following patches perform some code clean up in preparation for up coming
fixes.Functionality is not changed.
Dean Luick (6):
IB/hfi1: Remove unuseductxt->subpidanductxt->pidIB/hfi1: Remove unused functionhfi1_mmu_rb_searchIB/hfi1: Always expect ops functions
IB/hfi1: Make iovec loop index easy to understand IB/hfi1: Remove unneeded empty check inhfi1_mmu_rb_unregister()IB/hfi1: Rename TID mmu_rb_* functionsIra Weiny (7):
IB/hfi1: Fix minor format error
IB/hfi1: Add parameter names to function declarations IB/hfi1: Add parameter names to callback declarations IB/hfi1: Consolidate__mmu_rb_removeandhfi1_mmu_rb_removeIB/hfi1: Remove unused sub-context parameter IB/hfi1: Use "false" not 0
IB/hfi1: Restructurehfi1_file_open
Quoted 9 lines
drivers/infiniband/hw/hfi1/file_ops.c | 18 ++++---- drivers/infiniband/hw/hfi1/hfi.h | 11 +++-- drivers/infiniband/hw/hfi1/mmu_rb.c | 74 ++++++++-------------
----------
drivers/infiniband/hw/hfi1/mmu_rb.h | 13 +++---drivers/infiniband/hw/hfi1/user_exp_rcv.c| 33 +++++++------- drivers/infiniband/hw/hfi1/user_sdma.c | 11 ++---6 files changed, 62 insertions(+), 98 deletions(-)
Thanks Ira, series applied.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD