Re: [PATCH 1/5] md: add md_submit_discard_bio() for submitting discard bio

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

 





On 02/03/2021 11:44 PM, Christoph Hellwig wrote:
On Wed, Feb 03, 2021 at 09:45:27PM +0800, Xiao Ni wrote:
+	if (__blkdev_issue_discard(rdev->bdev, start, size,
+		GFP_NOIO, 0, &discard_bio) || !discard_bio)
+		return;
Very odd indentation.  Normally this would be:

	if (__blkdev_issue_discard(rdev->bdev, start, size, GFP_NOIO, 0,
			&discard_bio) || !discard_bio)
		return;

+
+	bio_chain(discard_bio, bio);
+	bio_clone_blkg_association(discard_bio, bio);
+	if (mddev->gendisk)
+		trace_block_bio_remap(discard_bio,
+				disk_devt(mddev->gendisk),
+				bio->bi_iter.bi_sector);
+	submit_bio_noacct(discard_bio);
+}
+EXPORT_SYMBOL(md_submit_discard_bio);
EXPORT_SYMBOL_GPL like all the other exports in md.c, please.

+extern void md_submit_discard_bio(struct mddev *mddev, struct md_rdev *rdev,
+			struct bio *bio, sector_t start, sector_t size);
no need for the extern.

Hi Christoph

It needs to export it here. If not, there is compile error.

raid0.c:502:3: error: implicit declaration of function ‘md_submit_discard_bio’ [-Werror=implicit-function-declaration]
   md_submit_discard_bio(mddev, rdev, bio,
   ^~~~~~~~~~~~~~~~~~~~~

I'll export it in the next version.

Regards
Xiao




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux