Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp36049pxk; Tue, 15 Sep 2020 19:32:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwES6Ll4wG1gry1rhHX6Ot4Iet8u5cRInsdZRjl+T8NelVzDRwbR4a0z5y0OGXNE7Q5yjIR X-Received: by 2002:a17:906:178d:: with SMTP id t13mr23971055eje.410.1600223531271; Tue, 15 Sep 2020 19:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600223531; cv=none; d=google.com; s=arc-20160816; b=NhDiLoWGYLRmXzCimXymzgYBv64p6QCjI3LmPC4qOfmDXKEzdo8dQwN6ehkq3/+2xz UXvvByfGOqbJY5PuZ5mg7tGSAkahQdprc5Ns6AwMbcnt8xeA38IjhUkoOmnb1jIZ6Eou /GEwoeJF9gsmmqFQYGF8/n68R2DMmLxxLbOs4IRslHH9sdD3925cifvJhplXfB7BEyXP FFxpPdCAA9gj7qXpShYaHadjKJuRn2S5KYPPF4hs8wgG50MKIm/90C/Z9OQ2Mtut5j33 atMCGOZD4IcBiR7E2tQ0ZfLiRd9/v3VdxSE5KhP2B/Y/nf6RrQDW6FT4c2OtG3HI43qj uhhg== 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 :message-id:date:subject:cc:to:from; bh=4CZdRWQaXzo6drjxX1VcNMwDBN0QrG+lUbuYNYTnDrM=; b=tyDvjnWH81OSJ2daey2QHiIJIGsm/UGyWyAQhV8BT0SXFMs2bY1z0IiDztzBybem6e WVrDyqWTzKqv0DFiHpFefOg01fZnrZPKrDpATc+ANY0oY/h/KOo6HVk+eXSp9j5DFkpO +8w5PGWT0Y/FfozZ30+UIdpHmnwS/QHxojqIcduF0ailTLvocW2wmNhwRcSChLofDyCS 0KBzex+w1rc6RqQszTo6QPL5BJ8cxPt263YVLZVqUb49uCcvizMO0uGWfC1IHVaVmMbr sOKbJIotKFXuJFe0iGzRdQpcbsd2bWlnZrbLBOg3P0PUg+EMY1nl3kFajDnF5N8LdBgV 1EPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si11248662edy.478.2020.09.15.19.31.48; Tue, 15 Sep 2020 19:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726538AbgIPC3R (ORCPT + 99 others); Tue, 15 Sep 2020 22:29:17 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57734 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726395AbgIPC16 (ORCPT ); Tue, 15 Sep 2020 22:27:58 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C48CB9466F007020C82C; Wed, 16 Sep 2020 10:27:52 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 16 Sep 2020 10:27:45 +0800 From: Liu Shixin To: Bob Peterson , Andreas Gruenbacher CC: , , Liu Shixin Subject: [PATCH -next] gfs2: convert to use DEFINE_SEQ_ATTRIBUTE macro Date: Wed, 16 Sep 2020 10:50:21 +0800 Message-ID: <20200916025021.3992575-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] 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_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin --- fs/gfs2/glock.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index f13b136654ca..15c5c26f6ae7 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -2415,7 +2415,7 @@ static const struct seq_operations gfs2_glstats_seq_ops = { .show = gfs2_glstats_seq_show, }; -static const struct seq_operations gfs2_sbstats_seq_ops = { +static const struct seq_operations gfs2_sbstats_sops = { .start = gfs2_sbstats_seq_start, .next = gfs2_sbstats_seq_next, .stop = gfs2_sbstats_seq_stop, @@ -2468,16 +2468,6 @@ static int gfs2_glstats_open(struct inode *inode, struct file *file) return __gfs2_glocks_open(inode, file, &gfs2_glstats_seq_ops); } -static int gfs2_sbstats_open(struct inode *inode, struct file *file) -{ - int ret = seq_open(file, &gfs2_sbstats_seq_ops); - if (ret == 0) { - struct seq_file *seq = file->private_data; - seq->private = inode->i_private; /* sdp */ - } - return ret; -} - static const struct file_operations gfs2_glocks_fops = { .owner = THIS_MODULE, .open = gfs2_glocks_open, @@ -2494,13 +2484,7 @@ static const struct file_operations gfs2_glstats_fops = { .release = gfs2_glocks_release, }; -static const struct file_operations gfs2_sbstats_fops = { - .owner = THIS_MODULE, - .open = gfs2_sbstats_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(gfs2_sbstats); void gfs2_create_debugfs_file(struct gfs2_sbd *sdp) { -- 2.25.1