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

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

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux