Re: [PATCH 3/7] block: Make blkdev_issue_zeroout use WRITE SAME

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

 



Il 02/03/2012 04:22, Martin K. Petersen ha scritto:
> +int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
> +			 sector_t nr_sects, gfp_t gfp_mask)
> +{
> +	if (bdev_write_same(bdev)) {
> +		unsigned char bdn[BDEVNAME_SIZE];
> +
> +		if (!blkdev_issue_write_same(bdev, sector, nr_sects, gfp_mask,
> +					     ZERO_PAGE(0)))
> +			return 0;
> +
> +		bdevname(bdev, bdn);
> +		printk(KERN_ERR "%s: WRITE SAME failed. Manually zeroing.\n",
> +		       bdn);
> +	}
> +
> +	return __blkdev_issue_zeroout(bdev, sector, nr_sects, gfp_mask);
> +}

Why not try DISCARD first if lbprz is true and the alignment is okay?
This doesn't even require WRITE SAME support in the disk.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux