From patchwork Wed Dec 11 20:42:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 181327 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1044043ile; Wed, 11 Dec 2019 12:47:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxIgYRmogk22BaUSo44YD+888smg8aeviazsrfFqo4CYdHi3t1ZlR8yxNgJs4uqYeychuQb X-Received: by 2002:a9d:7a8f:: with SMTP id l15mr3689283otn.109.1576097247124; Wed, 11 Dec 2019 12:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576097247; cv=none; d=google.com; s=arc-20160816; b=w2/eF/pejWivjBTEwazMmeNeCFI+KBK/0onDvMwS1zg6iIjWcFVnwLVRtAOMA+WUq0 CQ0WmzZ4X2MeMsCiZy2KoEaSTJsFj8oy1yzEfd++mV083ybllzFQyNIFEEjayad+/7Lx nVkjCPGaKYLGes+f0gUCfdAuh7YgBdEr7o3cc1DeD58RNRr9WNeaQiCo1reDWv8fcZZy q9kRDJ7NRkUOqOurIh+xgTZfVXKs/tqqP/h7LHg1lilaIPZOg8AgMWdzf95BBsUoy+3I Y13HX7xl2SCer0HSPtKHW5BEeFtN89IwLQQcdSmvJP1FrMJ6McrZmvLkyW4UGb6qxAO0 6pXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1AVkuICYuUJ9D3eRwQf8/7qao6yYJFs+YeK6ywV2mhg=; b=B61KMNQVACIZ/laAArj22TyrXMfaFRRenNiPP3ZT4D4JFWWTHjLdILMn51r/RQx13d EiXHWWG2mkW96aDZR61q/pM9g/vne+kdAmLDMEp8z2Ny4/+Y5fIL17hJJTxGn3d6Hq1P Q1F/wlHoSRAVjh5GwkFcun7NYiuYBJbadBkKZoUUreWXq6UdFC4AsdqvNEQQGAbVYPVn naVyOMZF65lty1p7naQavHakiCwuKlWyF6Y7TinNvytT4uwTZiHEvHabORpiq1KGeXv2 otrTTV453TqPvKwr9UTT0e63FWRYl22EXfuqyG0+skBuhVaLiTOw1SdngEE1L/wtVwZs eAXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si1835897otp.57.2019.12.11.12.47.26; Wed, 11 Dec 2019 12:47:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727104AbfLKUrZ (ORCPT + 27 others); Wed, 11 Dec 2019 15:47:25 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:44493 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbfLKUrZ (ORCPT ); Wed, 11 Dec 2019 15:47:25 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MYNS0-1iAqRJ0S8I-00VNnz; Wed, 11 Dec 2019 21:47:11 +0100 From: Arnd Bergmann To: Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Alexander Viro , FUJITA Tomonori Cc: linux-kernel@vger.kernel.org, y2038@lists.linaro.org, Arnd Bergmann , Chaitanya Kulkarni , Benjamin Block , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH 13/24] compat_ioctl: bsg: add handler Date: Wed, 11 Dec 2019 21:42:47 +0100 Message-Id: <20191211204306.1207817-14-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191211204306.1207817-1-arnd@arndb.de> References: <20191211204306.1207817-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:9E//4H5jUjxcz88C86R1AD+v07xscBKEn+U5T2BAdtLUAnLN0TR pJgxkACJ2VOrwR21uFSKt045qw16CVFBKgxXRjl0wRXdIi5qvgtMPA2iOaEdMhuh+mWULCt EUPuHtjCDvcR/p3/P41WVjN3SGzN2XxCq0aarb5ncSCwLZiBPEKJmhY3WKVzezophJM9sQp yCYgZnaFk6bm8zt5Q8ozA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:v55hPGbeD1k=:IimA31h3OAuyU1W0DDaoVL g3OvsSmdNHSaEs4Gs3UxXci2k4RCJNRBJKKffYXVlD10ugWEUY706Wsw/XVqt2dVNSIGEVXhA dvGgAN0AuKEfOq5Nr0oXoiJqkxCe44UFhuA7h+Sy4+bZja7QiweCUAynaH7Ek7yIHCu928Ez3 CvDvPNgttFkSqonwZYX3/RnPO1a3iQbOW1/vN6ND6tFLN8A/OYn4HidUrtseO+1mkmyG8FcnA iJXScjWKnL4tqXgMvrfRQkEFrOEGgf6UW7eKKIEr8ngL2bZmpuI197iNv5aTI1Pp+b+44SUs3 mQD4jJ0xqPv+j11bZNqRawcLFtm1spFQNnWb3tidW3guiC8lrJSajAlCE6/kvkRxmen5rxvrq XBhbze+FZfygxhggJERbbk+41YUTfg55I2gJVbXCrIkkTTnN0Od+/lQUkCQtMxYapqX7MIToa Em/vHawJc2dL4FVsupr2V+/H6OEcgHZfb4RMYLMdhqCUaJ31tesvtmvDd51l4SPNPhLznfeIy 7OVhdD05wE7GN98NgSBQBh0IYZOE82NOU3tvk9NScW44ZETUBByBOOavsTmG8xKUakgx8mMR6 exaE4zh0EwsTfnwNR7e7G+cS01mRpVT2XaIp1GTxEI3XptQRkiGak5XEQhVzoLtQlejkQEIF2 EeHI58uWrmr5WVkixR8GE95knlczX1j0ZOAnfGn/08CEylXQCV6hqKOlEGXq6rHu7qraoR0Mv sBXSSOxLCkiH35xBBwc8Fr0dMR9d9uAu4ubde7KiPPNX+5R5TRjsGYer3bj96/L5SAVl604vB r/PrNrfEq0chmpD/BedGKE5ayZasUml2ioBCsX2dmqJ+l8mZySv68q8O4gjp8CakeUK7DZsZc d0oG+rl2zmJMClUdj1yw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bsg_ioctl() calls into scsi_cmd_ioctl() for a couple of generic commands and relies on fs/compat_ioctl.c to handle it correctly in compat mode. Adding a private compat_ioctl() handler avoids that round-trip and lets us get rid of the generic emulation once this is done. Note that bsg implements an SG_IO command that is different from the other drivers and does not need emulation. Signed-off-by: Arnd Bergmann --- block/bsg.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.0 diff --git a/block/bsg.c b/block/bsg.c index 833c44b3d458..d7bae94b64d9 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -382,6 +382,7 @@ static const struct file_operations bsg_fops = { .open = bsg_open, .release = bsg_release, .unlocked_ioctl = bsg_ioctl, + .compat_ioctl = compat_ptr_ioctl, .owner = THIS_MODULE, .llseek = default_llseek, };