2021-05-25 18:08:21

by Ira Weiny

[permalink] [raw]
Subject: [PATCH 1/3] fs/fuse: Remove unneeded kaddr parameter

From: Ira Weiny <[email protected]>

fuse_dax_mem_range_init() does not need the address or the pfn of the
memory requested in dax_direct_access(). It is only calling direct
access to get the number of pages.

Remove the unused variables and stop requesting the kaddr and pfn from
dax_direct_access().

Reviewed-by: Dan Williams <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
---
fs/fuse/dax.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
index ff99ab2a3c43..34f8a5635c7f 100644
--- a/fs/fuse/dax.c
+++ b/fs/fuse/dax.c
@@ -1234,8 +1234,6 @@ void fuse_dax_conn_free(struct fuse_conn *fc)
static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
{
long nr_pages, nr_ranges;
- void *kaddr;
- pfn_t pfn;
struct fuse_dax_mapping *range;
int ret, id;
size_t dax_size = -1;
@@ -1247,8 +1245,8 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker);

id = dax_read_lock();
- nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), &kaddr,
- &pfn);
+ nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), NULL,
+ NULL);
dax_read_unlock(id);
if (nr_pages < 0) {
pr_debug("dax_direct_access() returned %ld\n", nr_pages);
--
2.28.0.rc0.12.gb6a658bd00c9


2021-06-11 17:24:47

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH 1/3] fs/fuse: Remove unneeded kaddr parameter

On Tue, May 25, 2021 at 10:24:26AM -0700, 'Ira Weiny' wrote:
> From: Ira Weiny <[email protected]>
>
> fuse_dax_mem_range_init() does not need the address or the pfn of the
> memory requested in dax_direct_access(). It is only calling direct
> access to get the number of pages.

In looking for feedback on this small series I realize that I failed to email
Miklos for the fs/fuse patch.

I'm adding Miklos to the To line...

For the rest of the series is there any feedback?

Ira

>
> Remove the unused variables and stop requesting the kaddr and pfn from
> dax_direct_access().
>
> Reviewed-by: Dan Williams <[email protected]>
> Signed-off-by: Ira Weiny <[email protected]>
> ---
> fs/fuse/dax.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
> index ff99ab2a3c43..34f8a5635c7f 100644
> --- a/fs/fuse/dax.c
> +++ b/fs/fuse/dax.c
> @@ -1234,8 +1234,6 @@ void fuse_dax_conn_free(struct fuse_conn *fc)
> static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
> {
> long nr_pages, nr_ranges;
> - void *kaddr;
> - pfn_t pfn;
> struct fuse_dax_mapping *range;
> int ret, id;
> size_t dax_size = -1;
> @@ -1247,8 +1245,8 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
> INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker);
>
> id = dax_read_lock();
> - nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), &kaddr,
> - &pfn);
> + nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), NULL,
> + NULL);
> dax_read_unlock(id);
> if (nr_pages < 0) {
> pr_debug("dax_direct_access() returned %ld\n", nr_pages);
> --
> 2.28.0.rc0.12.gb6a658bd00c9
>

2021-06-18 08:52:21

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 1/3] fs/fuse: Remove unneeded kaddr parameter

On Fri, 11 Jun 2021 at 19:23, Ira Weiny <[email protected]> wrote:
>
> On Tue, May 25, 2021 at 10:24:26AM -0700, 'Ira Weiny' wrote:
> > From: Ira Weiny <[email protected]>
> >
> > fuse_dax_mem_range_init() does not need the address or the pfn of the
> > memory requested in dax_direct_access(). It is only calling direct
> > access to get the number of pages.
>
> In looking for feedback on this small series I realize that I failed to email
> Miklos for the fs/fuse patch.
>
> I'm adding Miklos to the To line...

LGTM, but this is Vivek's code, so adding Cc.

Thanks,
Miklos


>
> For the rest of the series is there any feedback?
>
> Ira
>
> >
> > Remove the unused variables and stop requesting the kaddr and pfn from
> > dax_direct_access().
> >
> > Reviewed-by: Dan Williams <[email protected]>
> > Signed-off-by: Ira Weiny <[email protected]>
> > ---
> > fs/fuse/dax.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
> > index ff99ab2a3c43..34f8a5635c7f 100644
> > --- a/fs/fuse/dax.c
> > +++ b/fs/fuse/dax.c
> > @@ -1234,8 +1234,6 @@ void fuse_dax_conn_free(struct fuse_conn *fc)
> > static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
> > {
> > long nr_pages, nr_ranges;
> > - void *kaddr;
> > - pfn_t pfn;
> > struct fuse_dax_mapping *range;
> > int ret, id;
> > size_t dax_size = -1;
> > @@ -1247,8 +1245,8 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
> > INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker);
> >
> > id = dax_read_lock();
> > - nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), &kaddr,
> > - &pfn);
> > + nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), NULL,
> > + NULL);
> > dax_read_unlock(id);
> > if (nr_pages < 0) {
> > pr_debug("dax_direct_access() returned %ld\n", nr_pages);
> > --
> > 2.28.0.rc0.12.gb6a658bd00c9
> >

2021-06-18 13:07:52

by Vivek Goyal

[permalink] [raw]
Subject: Re: [PATCH 1/3] fs/fuse: Remove unneeded kaddr parameter

On Fri, Jun 18, 2021 at 09:01:39AM +0200, Miklos Szeredi wrote:
> On Fri, 11 Jun 2021 at 19:23, Ira Weiny <[email protected]> wrote:
> >
> > On Tue, May 25, 2021 at 10:24:26AM -0700, 'Ira Weiny' wrote:
> > > From: Ira Weiny <[email protected]>
> > >
> > > fuse_dax_mem_range_init() does not need the address or the pfn of the
> > > memory requested in dax_direct_access(). It is only calling direct
> > > access to get the number of pages.
> >
> > In looking for feedback on this small series I realize that I failed to email
> > Miklos for the fs/fuse patch.
> >
> > I'm adding Miklos to the To line...
>
> LGTM, but this is Vivek's code, so adding Cc.
>

Looks good to me as well. We are not using pfn and kaddr in
fuse_dax_mem_range_init().

Reviewed-by: Vivek Goyal <[email protected]>

Thanks
Vivek

> Thanks,
> Miklos
>
>
> >
> > For the rest of the series is there any feedback?
> >
> > Ira
> >
> > >
> > > Remove the unused variables and stop requesting the kaddr and pfn from
> > > dax_direct_access().
> > >
> > > Reviewed-by: Dan Williams <[email protected]>
> > > Signed-off-by: Ira Weiny <[email protected]>
> > > ---
> > > fs/fuse/dax.c | 6 ++----
> > > 1 file changed, 2 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
> > > index ff99ab2a3c43..34f8a5635c7f 100644
> > > --- a/fs/fuse/dax.c
> > > +++ b/fs/fuse/dax.c
> > > @@ -1234,8 +1234,6 @@ void fuse_dax_conn_free(struct fuse_conn *fc)
> > > static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
> > > {
> > > long nr_pages, nr_ranges;
> > > - void *kaddr;
> > > - pfn_t pfn;
> > > struct fuse_dax_mapping *range;
> > > int ret, id;
> > > size_t dax_size = -1;
> > > @@ -1247,8 +1245,8 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
> > > INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker);
> > >
> > > id = dax_read_lock();
> > > - nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), &kaddr,
> > > - &pfn);
> > > + nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), NULL,
> > > + NULL);
> > > dax_read_unlock(id);
> > > if (nr_pages < 0) {
> > > pr_debug("dax_direct_access() returned %ld\n", nr_pages);
> > > --
> > > 2.28.0.rc0.12.gb6a658bd00c9
> > >
>