Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6478672ybl; Mon, 23 Dec 2019 06:34:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzY805WFWlNCeJugYzaKgyxWSe6NlObQgBkdlDzfbJehb02CIQSYs44kYOg0Rs7YL9F9L/s X-Received: by 2002:a9d:4706:: with SMTP id a6mr30337373otf.331.1577111656238; Mon, 23 Dec 2019 06:34:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577111656; cv=none; d=google.com; s=arc-20160816; b=GFEGHsc4o1ZsBCWPt9ucHp8vPNX6Ylah2JKjUlgPXvLoSlhpY5qQPaIoiYI58InkKV ta9fFX/nE/cwN4f2zyw5N2pGUxHlDIFSctAzWU+vDOU+UQiO6G5KZhdhhfeBVoZbXWk+ 4JO9KXbWME/s1IDP/ViEyWS/PKDAjat37Y5McJPCia9w9X+F2RoUSVYYmGchM++ZCmDh 0MqQwJHxCuB5MbjBXU8wJ6CElxcLTE4SWPg+zKVrmb88ToVsHDt3SI4ZUrZrCNddmuBn LGBq0bjjMI+VtW7Cl7yFf5mX70jGE7HgC/xXqSxpxiyddSpGzQTtWDIjo9xBLA5nyfue 8SEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=4ravwOyjMpA7hMgeHXeo/SI1k5V5YqjLQGEJplVUsSs=; b=cNvpOmlICeVwK4QHuqkfXhICdkA8zVsmZ0pjNGjazzBzvxnZJBmaBv0vBx4G7iO8pM 9J7YeSpgqU0tdWue+T1KcOHWZKan+5lt3MRjTEB8ZtaBIRtJ9Na8GCAA+pp9z+3tQE0Z p/Z02U2QoStnh/sfigEzLsdws4I14t7cdN9Mn1Qll8wmEStZs/0uQzTeNw/O18tvXEis ImsCU75m6dZPFjzbLOmGNpJjdX+cQJhdiNm4J+2uM+tJLkCqA9M01f9ZmytjFm+p1ALg FA213tuvqsiAmjhZ7MvaE53jyRk/WsnWDlorF0P6llgnVz+FbCjMChvaOwSxTJhA9a8m rIxA== 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 a29si10324459otd.268.2019.12.23.06.34.03; Mon, 23 Dec 2019 06:34:16 -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 S1726944AbfLWOcR (ORCPT + 99 others); Mon, 23 Dec 2019 09:32:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8164 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726777AbfLWOcR (ORCPT ); Mon, 23 Dec 2019 09:32:17 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 2E9D8E26C98A02438037; Mon, 23 Dec 2019 22:32:15 +0800 (CST) Received: from localhost.localdomain (10.90.53.225) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Mon, 23 Dec 2019 22:32:06 +0800 From: Chen Wandun To: , , , , CC: Subject: [PATCH next] ceph: Fix debugfs_simple_attr.cocci warnings Date: Mon, 23 Dec 2019 22:39:18 +0800 Message-ID: <1577111958-100981-1-git-send-email-chenwandun@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Signed-off-by: Chen Wandun --- fs/ceph/debugfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index c281f32..60a0f1a 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -243,8 +243,8 @@ static int congestion_kb_get(void *data, u64 *val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get, - congestion_kb_set, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get, + congestion_kb_set, "%llu\n"); void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc) @@ -264,11 +264,11 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) dout("ceph_fs_debugfs_init\n"); fsc->debugfs_congestion_kb = - debugfs_create_file("writeback_congestion_kb", - 0600, - fsc->client->debugfs_dir, - fsc, - &congestion_kb_fops); + debugfs_create_file_unsafe("writeback_congestion_kb", + 0600, + fsc->client->debugfs_dir, + fsc, + &congestion_kb_fops); snprintf(name, sizeof(name), "../../bdi/%s", dev_name(fsc->sb->s_bdi->dev)); -- 2.7.4