Re: [PATCH 2/3] Add swap slot free callback to block_device_operations

From: Nigel Cunningham
Date: Fri May 07 2010 - 06:40:23 EST


Hi.

On 07/05/10 19:48, Nitin Gupta wrote:
+ if ((p->flags& SWP_BLKDEV)&&
+ disk->fops->swap_slot_free_notify)
+ disk->fops->swap_slot_free_notify(p->bdev, offset);

Is this p->flags& SWP_BLKDEV logic reversed? (Don't you want the
notifier called for devices that aren't backed by a block device?)


No, the logic here is correct: ramzswap is a block device for which
we want this callback. Though its a RAM backed, it is still a block
device.

(I hope it answers your question in the other mail also).

It does; thanks.

I also wonder whether leaving the p->flags& SWP_BLKDEV part out might
be a good idea. Other potential notifier users?


For regular files, 'offset' used here makes little sense. For block devices,
its simply offset in real device. Also, I doubt if *files* would ever
like to have such a callback.

Okay.

Entire series Acked-by: Nigel Cunningham <nigel@xxxxxxxxxxxx>

Thanks.

Nigel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/