From: Leon Romanovsky <leon@kernel.org>
To: Junxian Huang <huangjunxian6@hisilicon.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, linuxarm@huawei.com,
tangchengchang@huawei.com
Subject: Re: [PATCH for-next 2/3] RDMA/hns: Add write support to debugfs
Date: Fri, 13 Feb 2026 18:07:13 +0200 [thread overview]
Message-ID: <20260213160713.GU12887@unreal> (raw)
In-Reply-To: <28023174-dd0a-246e-ee0d-531b0bfda873@hisilicon.com>
On Fri, Feb 13, 2026 at 03:52:50PM +0800, Junxian Huang wrote:
>
>
> On 2026/2/13 0:55, Leon Romanovsky wrote:
> > On Fri, Feb 06, 2026 at 06:31:09PM +0800, Junxian Huang wrote:
> >> Add write support to debugfs.
> >>
> >> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
> >> ---
> >> drivers/infiniband/hw/hns/hns_roce_debugfs.c | 38 +++++++++++++++++---
> >> drivers/infiniband/hw/hns/hns_roce_debugfs.h | 1 +
> >> 2 files changed, 35 insertions(+), 4 deletions(-)
> >
> > <...>
> >
> >> static const struct file_operations hns_debugfs_seqfile_fops = {
> >> .owner = THIS_MODULE,
> >> .open = hns_debugfs_seqfile_open,
> >> .release = single_release,
> >> .read = seq_read,
> >> + .write = hns_debugfs_seqfile_write,
> >> .llseek = seq_lseek
> >> };
> >>
> >
> > <...>
> >
> >> - debugfs_create_file(name, 0400, parent, seq, &hns_debugfs_seqfile_fops);
> >> + debugfs_create_file(name, ops->write ? 0600 : 0400, parent,
> >> + seq, &hns_debugfs_seqfile_fops);
> >
> > What is this "ops->write ?" check? You added write callback in this
> > exactly patch. It is always true.
> >
>
> This ops is the function argument "const struct hns_debugfs_rw_ops *ops", not
> the file_operations hns_debugfs_seqfile_fops. This ops->write can be NULL when
> the file is read-only, such as the change in create_sw_stat_debugfs() in this
> patch.
Excellent, inline your init_debugfs_seqfile().
Thanks
>
> Junxian
>
> > Thanks
> >
next prev parent reply other threads:[~2026-02-13 16:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 10:31 [PATCH for-next 0/3] RDMA/hns: Support congestion control algorithm parameter configuration by debugfs Junxian Huang
2026-02-06 10:31 ` [PATCH for-next 1/3] RDMA/hns: Initialize seqfile before creating file Junxian Huang
2026-02-06 10:31 ` [PATCH for-next 2/3] RDMA/hns: Add write support to debugfs Junxian Huang
2026-02-12 16:55 ` Leon Romanovsky
2026-02-13 7:52 ` Junxian Huang
2026-02-13 16:07 ` Leon Romanovsky [this message]
2026-02-06 10:31 ` [PATCH for-next 3/3] RDMA/hns: Support congestion control algorithm parameter configuration Junxian Huang
2026-02-12 16:57 ` Leon Romanovsky
2026-02-13 8:36 ` Junxian Huang
2026-02-13 16:12 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260213160713.GU12887@unreal \
--to=leon@kernel.org \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=tangchengchang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox