From: Goldwyn Rodrigues <rgoldwyn@gmail.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] Track negative dentries
Date: Wed, 23 Jun 2010 15:27:50 -0500 [thread overview]
Message-ID: <AANLkTimK8sGY5nt5CxDeDfBQeJeGQ7LIqILifnTrR6Q8@mail.gmail.com> (raw)
In-Reply-To: <4C225B09.7000903@oracle.com>
On Wed, Jun 23, 2010 at 2:05 PM, Sunil Mushran <sunil.mushran@oracle.com> wrote:
> On 06/23/2010 11:25 AM, Goldwyn Rodrigues wrote:
>>>>
>>>> +void ocfs2_dentry_attach_gen(struct dentry *dentry)
>>>> +{
>>>> + ? ? ? int *gen = (int *)kmalloc(sizeof(int), GFP_KERNEL);
>>>> + ? ? ? *gen = OCFS2_I(dentry->d_parent->d_inode)->ip_generation;
>>>> + ? ? ? /* Generation numbers are specifically for negative dentries */
>>>> + ? ? ? if (dentry->d_inode)
>>>> + ? ? ? ? ? ? ? BUG();
>>>> + ? ? ? dentry->d_fsdata = (void *)gen;
>>>> +}
>>>> +
>>>>
>>>>
>>>
>>> kmalloc()s can fail. If this is just an int, why not just store it
>>> directly in d_fsdata. Add appropriate casts.
>>>
>>
>> This will cause compilation warnings for either x86_64 or i686 systems
>> depending on the data type we choose. I will do this anyways.
>>
>
> See if you can silence the warning. My main problem here is that
> we don't handle the error case. So if kmalloc() is seen as the best
> solution, go ahead use it, but do handle the ENOMEM case.
>
Oh yes, changing the (function) variables to long should do it, since
long is the same size as pointer.
I will make the change and test it. Thanks.
--
Goldwyn
next prev parent reply other threads:[~2010-06-23 20:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 15:02 [Ocfs2-devel] [PATCH] Track negative dentries Goldwyn Rodrigues
2010-06-18 16:06 ` Sunil Mushran
2010-06-23 18:25 ` Goldwyn Rodrigues
2010-06-23 19:05 ` Sunil Mushran
2010-06-23 20:27 ` Goldwyn Rodrigues [this message]
2010-06-23 21:01 ` Joel Becker
2010-06-23 21:32 ` Goldwyn Rodrigues
2010-06-21 4:27 ` Wengang Wang
2010-06-21 17:08 ` Sunil Mushran
2010-06-22 3:23 ` Wengang Wang
2010-06-22 3:36 ` Joel Becker
2010-06-22 5:22 ` Wengang Wang
2010-06-22 5:38 ` Sunil Mushran
2010-06-22 6:14 ` Wengang Wang
2010-06-22 16:53 ` Mark Fasheh
2010-06-23 4:57 ` Wengang Wang
2010-06-23 18:30 ` Goldwyn Rodrigues
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=AANLkTimK8sGY5nt5CxDeDfBQeJeGQ7LIqILifnTrR6Q8@mail.gmail.com \
--to=rgoldwyn@gmail.com \
--cc=ocfs2-devel@oss.oracle.com \
/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;
as well as URLs for NNTP newsgroup(s).