Thread (42 messages) 42 messages, 4 authors, 2023-08-18

Re: [PATCH 03/11] maple_tree: Add some helper functions

From: Liam R. Howlett <hidden>
Date: 2023-08-11 17:29:06
Also in: linux-fsdevel, linux-mm, lkml

* Peng Zhang [off-list ref] [230731 07:45]:

在 2023/7/26 23:08, Matthew Wilcox 写道:
quoted
On Wed, Jul 26, 2023 at 11:02:52AM -0400, Liam R. Howlett wrote:
quoted
* Peng Zhang [off-list ref] [230726 04:10]:
quoted
  static inline
-enum maple_type mas_parent_type(struct ma_state *mas, struct maple_enode *enode)
+enum maple_type ma_parent_type(struct maple_tree *mt, struct maple_node *node)
I was trying to keep ma_* prefix to mean the first argument is
maple_node and mt_* to mean maple_tree.  I wasn't entirely successful
with this and I do see why you want to use ma_, but maybe reverse the
arguments here?
I think your first idea is better.  Usually we prefer to order the
arguments by "containing thing" to "contained thing".  So always use
(struct address_space *, struct folio *), for example.  Or (struct
mm_struct *, struct vm_area_struct *).
There are disagreements here, so how to decide? But I don't know if the
new version still has this helper.
Please keep the maple tree as the first argument and use:
mt_parent_type as the name.. if you still need it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help