[PATCH 0/2] cifs: convert tlink_tree to a rbtree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new multiuser mount code in CIFS uses a radix tree to track
tcon_link entries. The main reason for this is historical. The initial
implementation that I did used a radix tree with pointers to
cifsTconInfo structs.

I chose that because it was possible that a tcon could be in more than
one tree at a time. It became evident in later versions however that I
needed a separate tracking struct to handle the refcounting. Thus, the
tcon_link was born, but I kept the initial design of a radix tree.

We recently had a bit of a kerfuffle surrounding the use of radix trees
with IMA to track inodes. While we'll likely have considerably fewer
radix tree entries, it's not really the best choice here either. The
tcon_link struct will only ever be in one tlink_tree, so we can embed
a tracking structure inside it.

This patchset converts that code to use a rbtree instead. This should
be as fast or faster than using a radix tree. It also has the benefit of
not requiring memory allocations on insertion which simplifies the
error handling in those codepaths.

Jeff Layton (2):
  cifs: store pointer to master tlink in superblock
  cifs: convert tlink_tree to a rbtree

 fs/cifs/cifs_fs_sb.h |    6 +-
 fs/cifs/cifsfs.c     |    2 +-
 fs/cifs/cifsglob.h   |    3 +-
 fs/cifs/connect.c    |  191 +++++++++++++++++++++++++------------------------
 4 files changed, 103 insertions(+), 99 deletions(-)

-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux