* [PATCH V2 linux-next] nfs: kmap can't fail
@ 2017-04-26 18:45 Fabian Frederick
2017-04-26 19:05 ` Trond Myklebust
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2017-04-26 18:45 UTC (permalink / raw)
To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs, linux-kernel, fabf
Remove NULL test on kmap()
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
V2: Remove ptr and return kmap(page) directly
(Suggested by Anna Schumaker)
fs/nfs/dir.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 3a188cb..12ed806b 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -175,13 +175,9 @@ typedef struct {
static
struct nfs_cache_array *nfs_readdir_get_array(struct page *page)
{
- void *ptr;
if (page == NULL)
return ERR_PTR(-EIO);
- ptr = kmap(page);
- if (ptr == NULL)
- return ERR_PTR(-ENOMEM);
- return ptr;
+ return kmap(page);
}
static
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V2 linux-next] nfs: kmap can't fail
2017-04-26 18:45 [PATCH V2 linux-next] nfs: kmap can't fail Fabian Frederick
@ 2017-04-26 19:05 ` Trond Myklebust
0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2017-04-26 19:05 UTC (permalink / raw)
To: anna.schumaker, Trond Myklebust, fabf; +Cc: linux-kernel, linux-nfs
On Wed, 2017-04-26 at 20:45 +0200, Fabian Frederick wrote:
> Remove NULL test on kmap()
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> V2: Remove ptr and return kmap(page) directly
> (Suggested by Anna Schumaker)
>
> fs/nfs/dir.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index 3a188cb..12ed806b 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -175,13 +175,9 @@ typedef struct {
> static
> struct nfs_cache_array *nfs_readdir_get_array(struct page *page)
> {
> - void *ptr;
> if (page == NULL)
> return ERR_PTR(-EIO);
> - ptr = kmap(page);
> - if (ptr == NULL)
> - return ERR_PTR(-ENOMEM);
> - return ptr;
> + return kmap(page);
> }
>
> static
There seems little value in having a wrapper to kmap... Can we perhaps
instead just get rid of both nfs_readdir_get_array and
nfs_readdir_release_array?
--
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-26 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 18:45 [PATCH V2 linux-next] nfs: kmap can't fail Fabian Frederick
2017-04-26 19:05 ` Trond Myklebust
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).