From: Josef Sipek <jsipek@fsl.cs.sunysb.edu>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: __getname vs kmalloc
Date: Wed, 4 Jan 2006 05:35:03 -0500 [thread overview]
Message-ID: <20060104103503.GA8708@filer.fsl.cs.sunysb.edu> (raw)
In-Reply-To: <1136369969.28640.24.camel@lade.trondhjem.org>
On Wed, Jan 04, 2006 at 11:19:29AM +0100, Trond Myklebust wrote:
> 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.
>
> Most callers use getname(), which also does the string length sanity
> checks and then copies the path from userland memory.
Ah, so since I am working with path components that'll get most of the
time passed to lookup_one_len & friends, kmalloc is the better way to
get memory, correct?
Thanks,
Jeff Sipek
prev parent reply other threads:[~2006-01-04 10:35 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
2006-01-04 10:35 ` Josef Sipek [this message]
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=20060104103503.GA8708@filer.fsl.cs.sunysb.edu \
--to=jsipek@fsl.cs.sunysb.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/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®