Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1407570
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Richard Weinberger <richard@nod.at> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with kmem_cache_zalloc |
| Date | Thu, 26 May 2016 16:10:01 +0200 |
| Message-ID | <rD493-7pp-11@gated-at.bofh.it> (permalink) |
| References | <rCPa2-6pL-15@gated-at.bofh.it> |
| X-Original-To | Salah Triki <salah.triki@acm.org>, dedekind1@gmail.com, adrian.hunter@intel.com |
| X-Greylist | delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Thu, 26 May 2016 10:05:54 EDT |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-15 |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 29 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Thu, 26 May 2016 15:59:10 +0200 |
| X-Original-Message-ID | <5747012E.2070803@nod.at> |
| X-Original-References | <1464213858-4032-1-git-send-email-salah.triki@acm.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1407570 |
Show key headers only | View raw
Am 26.05.2016 um 00:04 schrieb Salah Triki:
> Use kmem_cache_zalloc instead of kmem_cache_alloc/memset.
>
> Signed-off-by: Salah Triki <salah.triki@acm.org>
> ---
> fs/ubifs/super.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 7034995..f509200 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -262,12 +262,10 @@ static struct inode *ubifs_alloc_inode(struct super_block *sb)
> {
> struct ubifs_inode *ui;
>
> - ui = kmem_cache_alloc(ubifs_inode_slab, GFP_NOFS);
> + ui = kmem_cache_zalloc(ubifs_inode_slab, GFP_NOFS);
> if (!ui)
> return NULL;
>
> - memset((void *)ui + sizeof(struct inode), 0,
> - sizeof(struct ubifs_inode) - sizeof(struct inode));
Your patch fails to explain why it is needed.
Also note that the path slightly changes the semantics.
Thanks,
//richard
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with kmem_cache_zalloc Salah Triki <salah.triki@acm.org> - 2016-05-26 00:10 +0200 Re: [PATCH] fs: ubifs: Replace kmem_cache_alloc/memset with kmem_cache_zalloc Richard Weinberger <richard@nod.at> - 2016-05-26 16:10 +0200
csiph-web