linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Yan Zheng <yanzheng@21cn.com>, linux-fsdevel@vger.kernel.org
Subject: Re: [patch]anon_inodes.c: fix error check in anon_inode_getfd
Date: Thu, 27 Sep 2007 11:20:36 -0700	[thread overview]
Message-ID: <20070927112036.06512479.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0709271050550.763@alien.or.mcafeemobile.com>

On Thu, 27 Sep 2007 10:56:09 -0700 (PDT) Davide Libenzi <davidel@xmailserver.org> wrote:

> Open coded atomic_inc()? Hmm, dunno...

box:/usr/src/25> grep 'atomic_inc.*->i_count' */*.c
fs/block_dev.c:         atomic_inc(&bdev->bd_inode->i_count);
fs/block_dev.c:                 atomic_inc(&bdev->bd_inode->i_count);
fs/inode.c:             atomic_inc(&inode->i_count);
fs/inode.c:     atomic_inc(&inode->i_count);
fs/libfs.c:     atomic_inc(&inode->i_count);
fs/namei.c:                     atomic_inc(&inode->i_count);
ipc/mqueue.c:           atomic_inc(&inode->i_count);
kernel/futex.c:                 atomic_inc(&key->shared.inode->i_count);
mm/shmem.c:     atomic_inc(&inode->i_count);    /* New dentry reference */

The refcount on that inode is never zero *by design*.  So all we'd be doing
here is relying upon our existing design, so I think it'd be an OK thing to do. 
With appropriate code comments, of course.

  reply	other threads:[~2007-09-27 18:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27  2:30 [patch]anon_inodes.c: fix error check in anon_inode_getfd Yan Zheng
2007-09-27  3:59 ` Andrew Morton
2007-09-27 16:41   ` Davide Libenzi
2007-09-27 16:54     ` Davide Libenzi
2007-09-27 17:40       ` Andrew Morton
2007-09-27 17:56         ` Davide Libenzi
2007-09-27 18:20           ` Andrew Morton [this message]
2007-09-27 18:25             ` Davide Libenzi

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=20070927112036.06512479.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=yanzheng@21cn.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).