From patchwork Wed Sep 28 08:45:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9353355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3ED3C60756 for ; Wed, 28 Sep 2016 08:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FC4C29455 for ; Wed, 28 Sep 2016 08:47:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 245A329457; Wed, 28 Sep 2016 08:47:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B179429456 for ; Wed, 28 Sep 2016 08:47:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752339AbcI1IrJ (ORCPT ); Wed, 28 Sep 2016 04:47:09 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:43107 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752301AbcI1IrC (ORCPT ); Wed, 28 Sep 2016 04:47:02 -0400 X-IronPort-AV: E=Sophos;i="5.30,409,1470672000"; d="scan'208";a="18827720" Received: from mail-bn3nam01lp0181.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.181]) by ob1.hgst.iphmx.com with ESMTP; 28 Sep 2016 16:46:56 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-hgst-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ULTcNN4WDQY2j1n412F/Hn6FE42jLZqfbvpif5iq1gY=; b=Kmx2ohyU/enRjzZQwUKOe9Q7KWCJcvn80feWZFGx1lpE9CNFEw6W1a1Ow5T36Rajvx4y+htFD4Mi3mO+yNDuE94SUgAqUKW7a/RWjW1loMdPiI/ugHcONXEBHJi3KyxeYibhJwiGhbe8JZyg/ZnAU9CRttLEJsKtHo7jtqnve1k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Wed, 28 Sep 2016 08:46:53 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal , Shaun Tancheff Subject: [PATCH v4 7/7] blk-zoned: implement ioctls Date: Wed, 28 Sep 2016 17:45:39 +0900 Message-ID: <1475052339-10202-8-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475052339-10202-1-git-send-email-damien.lemoal@hgst.com> References: <1475052339-10202-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CO2PR18CA0029.namprd18.prod.outlook.com (10.161.80.39) To SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) X-MS-Office365-Filtering-Correlation-Id: 0b56a868-0335-4c3d-5fbd-08d3e77bffea X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 2:3GiCNjy4shHkHHWF081pLUFZP0WgMYMlEBLIRn/h67dnbe2Y0h8nRN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CAzHlwqeQ/leoFwiUzkRVLRicULVquZzOUkUatGc3D2KP+DD9B4XmfuUVhDeCUNb4GY8A3OvvTkaODu5fume9pboDq9OfIxngqsFs+WD1WaCxcofbmfKXZyPy/d4up9qfnGLNCkOj5vc5+rQ699nCwa2Wn+qoXzZ7AwERtD6pC1giT7EGTOYGeE3HxNsPs0dvTbqK0TRpVkn5i1cHPPKN2breD8V1NBv9v9bRhR+hYJpX2XSanzFZ3rk0jJ5uoS+QD8XLfU7um7IajPvgsJjv2zBHQ4cjv+4MPCOJPku83NYfOHblsoDDo4VfL6v7UoVstfv+dQHOnkMAVs0OhoeJT15A+IXiIx7DZSXe8e9PzTMxt1JirVmlHJqkPj8fkpRaK9uinGu7BtGD51chQpqVAHcFIgqRwruhfEcVYrTbTCAi67Xdu9gjw7L9w7pa/ybLgHFsfndAYycGCrwvEQ+qnRJwQG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:SN1PR04MB1983; BCL:0; PCL:0; RULEID:; SRVR:SN1PR04MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 4:wNkPitji3URrWML6jlbDhXSPpxdtcLfAWI48qQNnZtGEs6Rt+gzTnHALSmomaATih5qWVj2AW7f+H/b2tEu8JuC+nkeet07cQKrCHPmJBybHibaMGNiRgGNp7A5yBJcoxAQFrMpaCPUHPtdoj2pgsvRjAucm9d80tnm6QjkWx13zKSNP35ks8G+vJE428Kx/zRuLXTxrkjDVnbPOlLrGoZfEKqZmJhN11RITFxOdgzxenNDLqB+xVxNhFbBt0jHUm2ZmaykQyI9hZ++c9pXGI1gctFcywSxr0UMjBnJSG2MoEkdRgyG8jbxZspi25LGyH2ftNgUJGg4Mo0Mf22vqsej/sIO/AJga1sZW8Ccx9TzVdqqyZGIz7kf6oAjN3VUiFTL9s70d+fIBVRVs+jyecOdS5beVXWW6jkm3WiGLcf4iCXoLeJRygCCe/ygKIkIqaQe1UFHqc5RYEk+99Iat8g== X-Forefront-PRVS: 0079056367 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(77096005)(19580395003)(97736004)(2906002)(7846002)(19580405001)(305945005)(7736002)(5660300001)(68736007)(48376002)(66066001)(229853001)(575784001)(86362001)(110136003)(50466002)(5003940100001)(47776003)(81156014)(586003)(3846002)(106356001)(6116002)(36756003)(4326007)(81166006)(105586002)(42186005)(6916009)(8676002)(189998001)(33646002)(50226002)(76176999)(2950100002)(50986999)(92566002)(101416001)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR04MB1983; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: hgst.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR04MB1983; 23:MqgoQuagxXqOE7u2sdMK9u5azXN1wyeNNeZWfdg2R?= =?us-ascii?Q?WNG5rPb1DCxCquLgKya7KZpeyyA6CeU04gL/yybY/v1Bqkl5UQNEA+xMPkju?= =?us-ascii?Q?YDY1tTOsteEuBFji7cPc5oZYtNafPsNv17bOpnmctbUaU6RMEOjZCcd9lmKb?= =?us-ascii?Q?6YG/Hl55ypyxqQGwNIoA8Bo/rIV4PDnK8EcZN05R8/ZwBrJEqyIqZMBanMev?= =?us-ascii?Q?wex7T8JZ29vqhb0rh5VYv+itWinnH+PD5Mqd+rxPUAX8tERxhwBH9OMrJ3lL?= =?us-ascii?Q?qwsm8iE6rYehh9Lpe5X+KtK66cI/p/RZ2sIybmtvpyPu6DKicFUYgmkmy+Uc?= =?us-ascii?Q?bindEwi+HqB/4bmHajRHw2bKUiqOq7xMzouGfyX/6+jePN5XCCSaLFM2eV0N?= =?us-ascii?Q?oRNL1VxACoHSbt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xomTN2D X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 08:46:53.2321 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR04MB1983 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shaun Tancheff Adds the new BLKREPORTZONE and BLKRESETZONE ioctls for respectively obtaining the zone configuration of a zoned block device and resetting the write pointer of sequential zones of a zoned block device. The BLKREPORTZONE ioctl maps directly to a single call of the function blkdev_report_zones. The zone information result is passed as an array of struct blk_zone identical to the structure used internally for processing the REQ_OP_ZONE_REPORT operation. The BLKRESETZONE ioctl maps to a single call of the blkdev_reset_zones function. Signed-off-by: Shaun Tancheff Signed-off-by: Damien Le Moal --- block/blk-zoned.c | 93 +++++++++++++++++++++++++++++++++++++++++++ block/ioctl.c | 4 ++ include/linux/blkdev.h | 21 ++++++++++ include/uapi/linux/blkzoned.h | 40 +++++++++++++++++++ include/uapi/linux/fs.h | 4 ++ 5 files changed, 162 insertions(+) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 1603573..667f95d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -255,3 +255,96 @@ int blkdev_reset_zones(struct block_device *bdev, return 0; } EXPORT_SYMBOL_GPL(blkdev_reset_zones); + +/** + * BLKREPORTZONE ioctl processing. + * Called from blkdev_ioctl. + */ +int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + void __user *argp = (void __user *)arg; + struct request_queue *q; + struct blk_zone_report rep; + struct blk_zone *zones; + int ret; + + if (!argp) + return -EINVAL; + + q = bdev_get_queue(bdev); + if (!q) + return -ENXIO; + + if (!blk_queue_is_zoned(q)) + return -ENOTTY; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + if (copy_from_user(&rep, argp, sizeof(struct blk_zone_report))) + return -EFAULT; + + if (!rep.nr_zones) + return -EINVAL; + + zones = kcalloc(rep.nr_zones, sizeof(struct blk_zone), GFP_KERNEL); + if (!zones) + return -ENOMEM; + + ret = blkdev_report_zones(bdev, rep.sector, + zones, &rep.nr_zones, + GFP_KERNEL); + if (ret) + goto out; + + if (copy_to_user(argp, &rep, sizeof(struct blk_zone_report))) { + ret = -EFAULT; + goto out; + } + + if (rep.nr_zones) { + if (copy_to_user(argp + sizeof(struct blk_zone_report), zones, + sizeof(struct blk_zone) * rep.nr_zones)) + ret = -EFAULT; + } + + out: + kfree(zones); + + return ret; +} + +/** + * BLKRESETZONE ioctl processing. + * Called from blkdev_ioctl. + */ +int blkdev_reset_zones_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + void __user *argp = (void __user *)arg; + struct request_queue *q; + struct blk_zone_range zrange; + + if (!argp) + return -EINVAL; + + q = bdev_get_queue(bdev); + if (!q) + return -ENXIO; + + if (!blk_queue_is_zoned(q)) + return -ENOTTY; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + if (!(mode & FMODE_WRITE)) + return -EBADF; + + if (copy_from_user(&zrange, argp, sizeof(struct blk_zone_range))) + return -EFAULT; + + return blkdev_reset_zones(bdev, zrange.sector, zrange.nr_sectors, + GFP_KERNEL); +} diff --git a/block/ioctl.c b/block/ioctl.c index ed2397f..448f78a 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -513,6 +513,10 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, BLKDEV_DISCARD_SECURE); case BLKZEROOUT: return blk_ioctl_zeroout(bdev, mode, arg); + case BLKREPORTZONE: + return blkdev_report_zones_ioctl(bdev, mode, cmd, arg); + case BLKRESETZONE: + return blkdev_reset_zones_ioctl(bdev, mode, cmd, arg); case HDIO_GETGEO: return blkdev_getgeo(bdev, argp); case BLKRAGET: diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 252043f..90097dd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -316,6 +316,27 @@ extern int blkdev_report_zones(struct block_device *bdev, extern int blkdev_reset_zones(struct block_device *bdev, sector_t sectors, sector_t nr_sectors, gfp_t gfp_mask); +extern int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg); +extern int blkdev_reset_zones_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg); + +#else /* CONFIG_BLK_DEV_ZONED */ + +static inline int blkdev_report_zones_ioctl(struct block_device *bdev, + fmode_t mode, unsigned int cmd, + unsigned long arg) +{ + return -ENOTTY; +} + +static inline int blkdev_reset_zones_ioctl(struct block_device *bdev, + fmode_t mode, unsigned int cmd, + unsigned long arg) +{ + return -ENOTTY; +} + #endif /* CONFIG_BLK_DEV_ZONED */ struct request_queue { diff --git a/include/uapi/linux/blkzoned.h b/include/uapi/linux/blkzoned.h index a381721..40d1d7b 100644 --- a/include/uapi/linux/blkzoned.h +++ b/include/uapi/linux/blkzoned.h @@ -16,6 +16,7 @@ #define _UAPI_BLKZONED_H #include +#include /** * enum blk_zone_type - Types of zones allowed in a zoned device. @@ -100,4 +101,43 @@ struct blk_zone { __u8 reserved[36]; }; +/** + * struct blk_zone_report - BLKREPORTZONE ioctl request/reply + * + * @sector: starting sector of report + * @nr_zones: IN maximum / OUT actual + * @reserved: padding to 16 byte alignment + * @zones: Space to hold @nr_zones @zones entries on reply. + * + * The array of at most @nr_zones must follow this structure in memory. + */ +struct blk_zone_report { + __u64 sector; + __u32 nr_zones; + __u8 reserved[4]; + struct blk_zone zones[0]; +} __packed; + +/** + * struct blk_zone_range - BLKRESETZONE ioctl request + * @sector: starting sector of the first zone to issue reset write pointer + * @nr_sectors: Total number of sectors of 1 or more zones to reset + */ +struct blk_zone_range { + __u64 sector; + __u64 nr_sectors; +}; + +/** + * Zoned block device ioctl's: + * + * @BLKREPORTZONE: Get zone information. Takes a zone report as argument. + * The zone report will start from the zone containing the + * sector specified in the report request structure. + * @BLKRESETZONE: Reset the write pointer of the zones in the specified + * sector range. The sector range must be zone aligned. + */ +#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) +#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) + #endif /* _UAPI_BLKZONED_H */ diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 3b00f7c..e0fc7f0 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -222,6 +222,10 @@ struct fsxattr { #define BLKSECDISCARD _IO(0x12,125) #define BLKROTATIONAL _IO(0x12,126) #define BLKZEROOUT _IO(0x12,127) +/* + * A jump here: 130-131 are reserved for zoned block devices + * (see uapi/linux/blkzoned.h) + */ #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ #define FIBMAP _IO(0x00,1) /* bmap access */