linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pointer compare in md driver
@ 2017-10-30 23:55 wuzhouhui
  2017-10-31  1:03 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: wuzhouhui @ 2017-10-30 23:55 UTC (permalink / raw)
  To: linux-raid

Hi,

Sorry for disturbing, but I have consider this problem for several days.
I have a question when reading md driver. Following is the code from
linux/drivers/md/md.c, function md_do_sync():

>                for_each_mddev(mddev2, tmp) {
>                        if (mddev2 == mddev)
>                                continue;
>                        if (!mddev->parallel_resync
>                        &&  mddev2->curr_resync
>                        &&  match_mddev_units(mddev, mddev2)) {
>                                DEFINE_WAIT(wq);
>                                if (mddev < mddev2 && mddev->curr_resync == 2) {
>                                        /* arbitrarily yield */
>                                        mddev->curr_resync = 1;
>                                        wake_up(&resync_wait);
>                                }
>                                if (mddev > mddev2 && mddev->curr_resync == 1)
>                                        /* no need to wait here, we can wait the next
>                                         * time 'round when curr_resync == 2
>                                         */
>                                        continue;
>                                /* We need to wait 'interruptible' so as not to

The type of mddev2 and mddev both are struct mddev *, so what's the
meaning of comparing these two variables?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-31  1:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-30 23:55 Pointer compare in md driver wuzhouhui
2017-10-31  1:03 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).