[patch] UFS inode hash chain conversion to SLIST

Matthew Dillon dillon at apollo.backplane.com
Tue Jun 12 18:47:02 PDT 2007


:The attached patch is my attempt to convert the i_next field in struct
:inode to an SLIST.  I'm not sure if I handled the initialization
:correctly or if I handled the ilast part of ufs_ihashins() correctly.
:It seems to me that a STAILQ may be a better choice since it seems
:like all insertions are done on the tail of the list (queue).
:Comments are welcome.
:
:Thanks,
:Joe

    Well, there's no reason to kmalloc() little slist header chunks and
    assign them to ihashtbl.  Just make ihashtbl an array of slist headers.

    But, apart from that, an SLIST is not a good idea here, because
    deletions rescan the list (look at the mess SLIST_REMOVE() does in
    sys/queue.h).  A TAILQ would work ok, but I don't think there's a big
    enough reason to change the code to a TAILQ when the manual singly linked
    list works just fine.

						-Matt





More information about the Submit mailing list