All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: nick <xerofoify@gmail.com>
Cc: jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: Remove TO DO in jfs_xtree.c
Date: Mon, 29 Dec 2014 16:13:37 -0600	[thread overview]
Message-ID: <54A1D211.4080609@oracle.com> (raw)
In-Reply-To: <549F55AC.9040308@gmail.com>

On 12/27/2014 06:58 PM, nick wrote:
> Greetings Dave,
> I am wondering why there is a TO DO above this code:
>         * ToDo:  tlocks should be on doubly-linked list, so we can
>         * quickly remove it and add it to the end.

I'm sure the idea was to avoid the for loop needed to find the previous
entry in the linked list. A doubly-linked list makes it much simpler to
remove an item from an arbitrary position in the list.

>         */
> 
>        /*
>        * Move parent page's tlock to the end of the tid's tlock list
>        */
>        if (log && mp->lid && (tblk->last != mp->lid) &&
>            lid_to_tlock(mp->lid)->tid) {
>                lid_t lid = mp->lid;
>                 struct tlock *prev;
> 
>              tlck = lid_to_tlock(lid);
> 
>              if (tblk->next == lid)
>                        tblk->next = tlck->next;
>              else {
>                        for (prev = lid_to_tlock(tblk->next);
>                              prev->next != lid;
>                             prev = lid_to_tlock(prev->next)) {
>                               assert(prev->next);
>                       }
>                         prev->next = tlck->next;
>               }
>               lid_to_tlock(tblk->last)->next = lid;
>               tlck->next = 0;
>                tblk->last = lid;
>        }
> As this code clearly moves the locks onto a linked list. Therefore I am recommend we remove this
> TO DO as this is clearly misleading and no longer needed.

That comment has been in the code forever and I don't have any intention
of changing things, but I don't think it's wrong. I don't mind removing
it, though. jfs has been barely maintained and there is a ton of cleanup
that can be done if someone were willing to take the time to do it.

Thanks,
Shaggy

       reply	other threads:[~2014-12-29 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <549F55AC.9040308@gmail.com>
2014-12-29 22:13 ` Dave Kleikamp [this message]
2014-12-30  3:48   ` Remove TO DO in jfs_xtree.c tytso
2014-12-30  4:02     ` Dave Kleikamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A1D211.4080609@oracle.com \
    --to=dave.kleikamp@oracle.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xerofoify@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.