From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH] remove v_number
Date: Wed, 29 Nov 2006 16:47:29 +0100 [thread overview]
Message-ID: <20061129154729.GC6400@lst.de> (raw)
v_number is unused except for the naming some locks (which is a
functionality totally unused by Linux), so remove it and assorted
crap. Besides saving two words in struct vnode this also gets rid
of a spinlock per inode allocation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/xfs/linux-2.6/xfs_vnode.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_vnode.c 2006-11-29 16:37:23.000000000 +0100
+++ linux-2.6/fs/xfs/linux-2.6/xfs_vnode.c 2006-11-29 16:38:09.000000000 +0100
@@ -17,8 +17,6 @@
*/
#include "xfs.h"
-uint64_t vn_generation; /* vnode generation number */
-DEFINE_SPINLOCK(vnumber_lock);
/*
* Dedicated vnode inactive/reclaim sync semaphores.
@@ -82,12 +80,6 @@
vp->v_flag = VMODIFIED;
spinlock_init(&vp->v_lock, "v_lock");
- spin_lock(&vnumber_lock);
- if (!++vn_generation) /* v_number shouldn't be zero */
- vn_generation++;
- vp->v_number = vn_generation;
- spin_unlock(&vnumber_lock);
-
ASSERT(VN_CACHED(vp) == 0);
/* Initialize the first behavior and the behavior chain head. */
Index: linux-2.6/fs/xfs/linux-2.6/xfs_vnode.h
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_vnode.h 2006-11-29 16:38:13.000000000 +0100
+++ linux-2.6/fs/xfs/linux-2.6/xfs_vnode.h 2006-11-29 16:39:08.000000000 +0100
@@ -41,7 +41,6 @@
typedef struct bhv_vnode {
bhv_vflags_t v_flag; /* vnode flags (see above) */
bhv_vfs_t *v_vfsp; /* ptr to containing VFS */
- bhv_vnumber_t v_number; /* in-core vnode number */
bhv_head_t v_bh; /* behavior head */
spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
atomic_t v_iocount; /* outstanding I/O count */
Index: linux-2.6/fs/xfs/xfs_iget.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_iget.c 2006-11-29 16:36:19.000000000 +0100
+++ linux-2.6/fs/xfs/xfs_iget.c 2006-11-29 16:37:14.000000000 +0100
@@ -570,8 +570,8 @@
bhv_vnode_t *vp)
{
mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
- "xfsino", (long)vp->v_number);
- mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", vp->v_number);
+ "xfsino", ip->i_ino);
+ mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino);
init_waitqueue_head(&ip->i_ipin_wait);
atomic_set(&ip->i_pincount, 0);
initnsema(&ip->i_flock, 1, "xfsfino");
next reply other threads:[~2006-11-29 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-29 15:47 Christoph Hellwig [this message]
2006-11-30 0:30 ` [PATCH] remove v_number David Chinner
2006-12-04 11:34 ` Christoph Hellwig
2006-12-04 21:56 ` David Chinner
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=20061129154729.GC6400@lst.de \
--to=hch@lst.de \
--cc=xfs@oss.sgi.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