tech-kern archive

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

Re: pserialize-safe queue(3) alternative



Hi,

On 2016/04/07 17:50, Kengo NAKAHARA wrote:
> Hi,
> 
> On 2016/04/04 3:23, Taylor R Campbell wrote:
>>    Date: Sun, 3 Apr 2016 18:20:06 +0000
>>    From: Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost>
>>
>>    The attached pslist.h implements a pserialize-safe alternative to the
>>    LIST_* operations in queue(3), with example use in pslist.c:
>>
>> ...actually attached, this time for real!
> 
> I have a question. It seems that pslist_writer_insert_after() does not
> change old entry->ple_next->ple_prevp. I think pslist_writer_insert_after()
> may be only used to add last element. If that is correct, I think
> "pslist_writer_insert_last" might be better for the function name.
> 
> For the rest, it looks good to me. I'm eager that it is committed.

Sorry, I found one more question. _pslist_writer_next_container() does
not use "next" variable. I think the following patch is required.
====================
--- a/sys/sys/pslist.h
+++ b/sys/sys/pslist.h
@@ -130,7 +130,7 @@ _pslist_writer_next_container(struct pslist_entry *entry, ptrdiff_t offset)
 {
        struct pslist_entry *next = entry->ple_next;
 
-       return (next == NULL ? NULL : (char *)entry - offset);
+       return (next == NULL ? NULL : (char *)next - offset);
 }
====================


Thanks,

-- 
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.

Device Engineering Section,
IoT Platform Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>


Home | Main Index | Thread Index | Old Index