mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Josef Sipek <jsipek@fsl.cs.sunysb.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: __getname vs kmalloc
Date: Wed, 04 Jan 2006 11:19:29 +0100	[thread overview]
Message-ID: <1136369969.28640.24.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20060104063251.GA4263@filer.fsl.cs.sunysb.edu>

On Wed, 2006-01-04 at 01:32 -0500, Josef Sipek wrote:
> Which is the prefered method of allocating memory __getname or kmalloc?

Depends entirely on the purpose. __getname uses the "names_cache" slab
and allocates PATH_MAX sized chunks. It is mainly supposed to be used
for temporary storage of an entire path.

> I looked at the source, and it appears to be used by 9p, smbfs, parts
> of VFS. In total there are only 10 calls to it.

Most callers use getname(), which also does the string length sanity
checks and then copies the path from userland memory.

Cheers,
  Trond


  reply	other threads:[~2006-01-04 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-04  6:32 Josef Sipek
2006-01-04 10:19 ` Trond Myklebust [this message]
2006-01-04 10:35   ` Josef Sipek

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=1136369969.28640.24.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=jsipek@fsl.cs.sunysb.edu \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®