All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] omfs: make use of kmemdup
@ 2019-09-13 17:11 Saiyam Doshi
  2019-09-14  6:24   ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: Saiyam Doshi @ 2019-09-13 17:11 UTC (permalink / raw)
  To: me; +Cc: linux-karma-devel, linux-kernel

Replace call to kmalloc followed by memcpy with a direct call
to kmemdup to achieve same functionality.

Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
---
 fs/omfs/inode.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index b76ec6b88ded..788b41096962 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -363,12 +363,13 @@ static int omfs_get_imap(struct super_block *sb)
 		bh = sb_bread(sb, block++);
 		if (!bh)
 			goto nomem_free;
-		*ptr = kmalloc(sb->s_blocksize, GFP_KERNEL);
+
+		*ptr = kmemdup(bh->b_data, sb->s_blocksize, GFP_KERNEL);
 		if (!*ptr) {
 			brelse(bh);
 			goto nomem_free;
 		}
-		memcpy(*ptr, bh->b_data, sb->s_blocksize);
+
 		if (count < sb->s_blocksize)
 			memset((void *)*ptr + count, 0xff,
 				sb->s_blocksize - count);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: omfs: make use of kmemdup
  2019-09-13 17:11 [PATCH] omfs: make use of kmemdup Saiyam Doshi
@ 2019-09-14  6:24   ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-09-14  6:24 UTC (permalink / raw)
  To: Saiyam Doshi, Bob Copeland
  Cc: linux-karma-devel, linux-kernel, kernel-janitors

> Replace call to kmalloc followed by memcpy with a direct call
> to kmemdup to achieve same functionality.

I suggest to take another look at a similar patch.

fs/omfs: make use of kmemdup
https://lore.kernel.org/r/20190721112326.GA5927@hari-Inspiron-1545/
https://lore.kernel.org/patchwork/patch/1102482/
https://lkml.org/lkml/2019/7/21/40

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: omfs: make use of kmemdup
@ 2019-09-14  6:24   ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-09-14  6:24 UTC (permalink / raw)
  To: Saiyam Doshi, Bob Copeland
  Cc: linux-karma-devel, linux-kernel, kernel-janitors

> Replace call to kmalloc followed by memcpy with a direct call
> to kmemdup to achieve same functionality.

I suggest to take another look at a similar patch.

fs/omfs: make use of kmemdup
https://lore.kernel.org/r/20190721112326.GA5927@hari-Inspiron-1545/
https://lore.kernel.org/patchwork/patch/1102482/
https://lkml.org/lkml/2019/7/21/40

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: omfs: make use of kmemdup
  2019-09-14  6:24   ` Markus Elfring
  (?)
@ 2019-09-16 17:13   ` Saiyam Doshi
  -1 siblings, 0 replies; 4+ messages in thread
From: Saiyam Doshi @ 2019-09-16 17:13 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Bob Copeland, linux-karma-devel, linux-kernel

On Sat, Sep 14, 2019 at 08:24:37AM +0200, Markus Elfring wrote:
> I suggest to take another look at a similar patch.
> 
> fs/omfs: make use of kmemdup
> https://lore.kernel.org/r/20190721112326.GA5927@hari-Inspiron-1545/
> https://lore.kernel.org/patchwork/patch/1102482/
> https://lkml.org/lkml/2019/7/21/40

Oh I missed that. The patch you pointed above is of July, 2019 but I am
not seeing it in v5.3 or in next-20190915.

If you know, can you point to the fs/omfs tree. It will help not to send
repeated change.

-Saiyam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-16 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 17:11 [PATCH] omfs: make use of kmemdup Saiyam Doshi
2019-09-14  6:24 ` Markus Elfring
2019-09-14  6:24   ` Markus Elfring
2019-09-16 17:13   ` Saiyam Doshi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.