From patchwork Thu Sep 22 12:13:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 76750 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2563564qgf; Thu, 22 Sep 2016 05:17:50 -0700 (PDT) X-Received: by 10.55.32.67 with SMTP id g64mr1578460qkg.106.1474546670951; Thu, 22 Sep 2016 05:17:50 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r3si918581qkc.252.2016.09.22.05.17.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2wo-0001MC-BT for patch@linaro.org; Thu, 22 Sep 2016 08:17:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2u5-0008D4-TX for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn2u1-0006NA-PC for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:01 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:34161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2u1-0006Mo-Hz for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:14:57 -0400 Received: by mail-lf0-f47.google.com with SMTP id y6so65848911lff.1 for ; Thu, 22 Sep 2016 05:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=27WxVhZVWmDa3YU9EV58zSf5hEL8olTuDy01JZpoRYg=; b=idM3+Xz18sQaSUMFbmbkVgho3pDgopy/B90twS/+8YpaoCNQ4qR1FOWm99pMyQdebK XnEFDjkSTWimjhT4tw5OgKMgdN/HD+y4PASJbTL9O3DX9Gu4lNLeVVHhU1QFLb6VNerT cwVTXVYWVj+kj2nbcngrF9B9mACAZmPalpCMs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=27WxVhZVWmDa3YU9EV58zSf5hEL8olTuDy01JZpoRYg=; b=kJ6Y3HMRG2RV5TRQdMrOE6GBVtZnkIoU+mYh9YtixzizpXJoWALIBiZGQ6z9kYmubO Kqe7lMEbynirgVQ8o3E3ASs0NGxh4oZFlO+2BSABmWVc1R7K6q1wGS8EdknEwGcJTpCk JILFYF73/lLbPIFc5PP3VtmO15f9Ipte93oPKkY1rzw5TQOhHmob+L3IJPR78H2KPsqP m0/l4Vug7vWgKsIL9eV20vKmzOGytA6ogfXtBfom9S/cmEiwYvuwNjyXgVIskizEuIfd bTEnC2dYxtsTSgAws+waKqOWVqzVZw/5SkF/47kUQZOPkES/I04VKom6XeqZABD8Q0GR LL1Q== X-Gm-Message-State: AE9vXwO3BbyVz2DICAGVseKTnveJbsPrYgEQ5U1dt7okSxhlcNfKoBs/IzenIzCZ22O6JK2N X-Received: by 10.25.142.203 with SMTP id q194mr732726lfd.11.1474546436722; Thu, 22 Sep 2016 05:13:56 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id u14sm294378lja.11.2016.09.22.05.13.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:13:54 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 15:13:24 +0300 Message-Id: <6080723102d1ad3b553769834d6a23e3f3d8250f.1474546244.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.47 Subject: [Qemu-devel] [PULL 04/26] linux-user: Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Implement the FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls, as used by chattr. Note that the type information encoded in these ioctl numbers is at odds with the actual type the kernel accesses, as discussed in http://thread.gmane.org/gmane.linux.file-systems/80164. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 6 ++++++ 2 files changed, 9 insertions(+) -- 2.1.4 diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 7e2c133..1bad701 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -120,6 +120,9 @@ MK_PTR(MK_STRUCT(STRUCT_fiemap))) #endif + IOCTL(FS_IOC_GETFLAGS, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) + IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT)) IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT)) IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index c0c9b58..c0e5cb0 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -998,6 +998,12 @@ struct target_pollfd { #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ +/* Note that the ioctl numbers claim type "long" but the actual type + * used by the kernel is "int". + */ +#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, long) +#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, long) + #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap) /* cdrom commands */