From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02E13CA9EAE for ; Wed, 30 Oct 2019 02:42:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CEF3120856 for ; Wed, 30 Oct 2019 02:42:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEF3120856 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1F8566B0003; Tue, 29 Oct 2019 22:42:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A95F6B0006; Tue, 29 Oct 2019 22:42:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 098A66B0007; Tue, 29 Oct 2019 22:42:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id DFD346B0003 for ; Tue, 29 Oct 2019 22:42:37 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 5E0708249980 for ; Wed, 30 Oct 2019 02:42:37 +0000 (UTC) X-FDA: 76098902754.30.stop14_33da49b4fa540 X-HE-Tag: stop14_33da49b4fa540 X-Filterd-Recvd-Size: 2100 Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Oct 2019 02:42:36 +0000 (UTC) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1E0A257D3F9DFC242AE1; Wed, 30 Oct 2019 10:42:31 +0800 (CST) Received: from [127.0.0.1] (10.133.219.218) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 30 Oct 2019 10:42:29 +0800 Message-ID: <5DB8F895.5050508@huawei.com> Date: Wed, 30 Oct 2019 10:42:29 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Andrew Morton CC: , , Subject: Re: [PATCH] mm/cma_debug: Use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops References: <1572348687-9951-1-git-send-email-zhongjiang@huawei.com> <20191029143636.6ef9390992ffd1879ac9ad3b@linux-foundation.org> In-Reply-To: <20191029143636.6ef9390992ffd1879ac9ad3b@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.133.219.218] X-CFilter-Loop: Reflected X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2019/10/30 5:36, Andrew Morton wrote: > On Tue, 29 Oct 2019 19:31:27 +0800 zhong jiang wrote: > >> It is more clear to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs >> file operation rather than DEFINE_SIMPLE_ATTRIBUTE. > hm, they do appear to be identical. It seems to DEFINE_DEBUGFS_ATTRIBUTE is special part of DEFINE_SIMPLE_ATTRUBUTE. Defined file operation is different. but use DEFINE_DEBUGFS_ATTRIBUTE to define normal fops also feasible. > Perhaps DEFINE_DEBUGFS_ATTRIBUTE shouldn't exist, or should be #defined > onto DEFINE_SIMPLE_ATTRIBUTE? > > > . Debugfs fops has an long existing in kernel. And file read and write has different implementation. I tend to keep in the way it was. Thanks, zhong jiang >