From patchwork Thu Apr 2 15:06:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 1265641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48tRJC3wwZz9sR4 for ; Fri, 3 Apr 2020 02:07:39 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8BD493C2FF1 for ; Thu, 2 Apr 2020 17:07:36 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 48EB03C3030 for ; Thu, 2 Apr 2020 17:07:04 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-2.smtp.seeweb.it (Postfix) with ESMTP id 484CF601B08 for ; Thu, 2 Apr 2020 17:06:58 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.72,335,1580745600"; d="scan'208";a="88404610" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 02 Apr 2020 23:06:50 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id B2BCA406AB15 for ; Thu, 2 Apr 2020 22:56:27 +0800 (CST) Received: from G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 23:06:46 +0800 Received: from localhost.localdomain (10.167.220.84) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Apr 2020 23:06:46 +0800 From: Yang Xu To: Date: Thu, 2 Apr 2020 23:06:21 +0800 Message-ID: <1585839990-19923-2-git-send-email-xuyang2018.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1585839990-19923-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> References: <1585839990-19923-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-yoursite-MailScanner-ID: B2BCA406AB15.AFF27 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com X-Spam-Status: No, score=0.3 required=7.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH v1 01/10] lapi: Add a configure check and fallback for loop ioctl and flag X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Yang Xu --- configure.ac | 1 + include/lapi/loop.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 include/lapi/loop.h diff --git a/configure.ac b/configure.ac index e1069b57e..e088cb564 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,7 @@ AC_CHECK_HEADERS([ \ linux/if_ether.h \ linux/if_packet.h \ linux/keyctl.h \ + linux/loop.h \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \ diff --git a/include/lapi/loop.h b/include/lapi/loop.h new file mode 100644 index 000000000..bc6d9950d --- /dev/null +++ b/include/lapi/loop.h @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2020 FUJITSU LIMITED. All rights reserved. + * Author: Yang Xu + */ +#ifndef LAPI_LOOP_H +#define LAPI_LOOP_H + +#include +#ifdef HAVE_LINUX_LOOP_H +# include +#endif + +#ifndef LO_FLAGS_PARTSCAN +# define LO_FLAGS_PARTSCAN 8 +#endif + +#ifndef LO_FLAGS_DIRECT_IO +# define LO_FLAGS_DIRECT_IO 16 +#endif + +#ifndef LOOP_SET_CAPACITY +# define LOOP_SET_CAPACITY 0x4C07 +#endif + +#ifndef LOOP_SET_DIRECT_IO +# define LOOP_SET_DIRECT_IO 0x4C08 +#endif + +#ifndef LOOP_SET_BLOCK_SIZE +# define LOOP_SET_BLOCK_SIZE 0x4C09 +#endif + +#endif +