From ce4bc82d197d8c3b7ff7f4cae17c82ce6d490227 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Wed, 12 Jun 2013 12:51:43 +0000 Subject: Use direct custom implementations instead of g_handleattr() for CFI and NAND d_getattr(). Since these drivers use disk(9) KPI and not directly GEOM, use of that function means KPI layering violation, causing extra g_io_deliver() call for the request. --- sys/dev/cfi/cfi_disk.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'sys/dev/cfi') diff --git a/sys/dev/cfi/cfi_disk.c b/sys/dev/cfi/cfi_disk.c index 723d1aeeff75..f5bcb1b67fad 100644 --- a/sys/dev/cfi/cfi_disk.c +++ b/sys/dev/cfi/cfi_disk.c @@ -292,14 +292,13 @@ cfi_disk_getattr(struct bio *bp) sc = dsc->parent; dev = sc->sc_dev; - do { - if (g_handleattr(bp, "CFI::device", &dev, sizeof(device_t))) - break; - - return (ERESTART); - } while(0); - - return (EJUSTRETURN); + if (strcmp(bp->bio_attribute, "CFI::device") == 0) { + if (bp->bio_length != sizeof(dev)) + return (EFAULT); + bcopy(&dev, bp->bio_data, sizeof(dev)); + } else + return (-1); + return (0); } -- cgit v1.2.3