[Ocfs2-commits] jlbec commits r2305 - branches/alloc_inode/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri May 20 23:21:30 CDT 2005
Author: jlbec
Date: 2005-05-20 23:21:29 -0500 (Fri, 20 May 2005)
New Revision: 2305
Modified:
branches/alloc_inode/fs/ocfs2/aio.c
branches/alloc_inode/fs/ocfs2/alloc.c
branches/alloc_inode/fs/ocfs2/aops.c
branches/alloc_inode/fs/ocfs2/dlmglue.c
branches/alloc_inode/fs/ocfs2/file.c
branches/alloc_inode/fs/ocfs2/inode.c
branches/alloc_inode/fs/ocfs2/localalloc.c
branches/alloc_inode/fs/ocfs2/namei.c
branches/alloc_inode/fs/ocfs2/ocfs.h
branches/alloc_inode/fs/ocfs2/super.c
Log:
o Move ip_alloc_sem to ocfs2_inode_info.
o Remove ocfs_inode_private. Hooray!
Modified: branches/alloc_inode/fs/ocfs2/aio.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/aio.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/aio.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -70,7 +70,7 @@
if (okp->kp_info.wl_unlock_ctxt)
ocfs2_unlock_buffer_inodes(&okp->kp_ctxt);
if (okp->kp_have_alloc_sem)
- up_read(&OCFS_I(okp->kp_inode)->ip_alloc_sem);
+ up_read(&OCFS2_I(okp->kp_inode)->ip_alloc_sem);
iput(okp->kp_inode);
kfree(okp);
@@ -280,7 +280,7 @@
/* hold the ip_alloc_sem across the op */
if (!okp->kp_have_alloc_sem) {
- down_read(&OCFS_I(inode)->ip_alloc_sem);
+ down_read(&OCFS2_I(inode)->ip_alloc_sem);
okp->kp_have_alloc_sem = 1;
}
@@ -344,7 +344,7 @@
/* hold the ip_alloc_sem across the op */
if (!okp->kp_have_alloc_sem) {
- down_read(&OCFS_I(inode)->ip_alloc_sem);
+ down_read(&OCFS2_I(inode)->ip_alloc_sem);
okp->kp_have_alloc_sem = 1;
}
Modified: branches/alloc_inode/fs/ocfs2/alloc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/alloc.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/alloc.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -1668,7 +1668,7 @@
mlog_entry_void();
- down_write(&OCFS_I(inode)->ip_alloc_sem);
+ down_write(&OCFS2_I(inode)->ip_alloc_sem);
target_i_clusters = ocfs2_clusters_for_bytes(osb->sb,
i_size_read(inode));
@@ -1783,7 +1783,7 @@
if (fe->i_clusters > target_i_clusters)
goto start;
bail:
- up_write(&OCFS_I(inode)->ip_alloc_sem);
+ up_write(&OCFS2_I(inode)->ip_alloc_sem);
ocfs2_schedule_truncate_log_flush(osb, 1);
Modified: branches/alloc_inode/fs/ocfs2/aops.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/aops.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/aops.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -293,14 +293,14 @@
mlog_errno(err);
goto bail;
}
- down_read(&OCFS_I(inode)->ip_alloc_sem);
+ down_read(&OCFS2_I(inode)->ip_alloc_sem);
}
err = ocfs2_extent_map_get_blocks(inode, block, 1, &p_blkno,
NULL);
if (!INODE_JOURNAL(inode)) {
- up_read(&OCFS_I(inode)->ip_alloc_sem);
+ up_read(&OCFS2_I(inode)->ip_alloc_sem);
ocfs2_meta_unlock(inode, 0);
}
Modified: branches/alloc_inode/fs/ocfs2/dlmglue.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/dlmglue.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/dlmglue.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -598,8 +598,6 @@
OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
- OCFS_ASSERT(OCFS_I(inode)->ip_flags & OCFS_INODE_INITIALIZED);
-
spin_lock(&lockres->l_lock);
lksb = &(lockres->l_lksb);
Modified: branches/alloc_inode/fs/ocfs2/file.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/file.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/file.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -238,7 +238,7 @@
if (ret)
goto bail;
- down_read(&OCFS_I(inode)->ip_alloc_sem);
+ down_read(&OCFS2_I(inode)->ip_alloc_sem);
#ifdef OCFS2_ORACORE_WORKAROUNDS
saved_flags = filp->f_flags;
@@ -252,7 +252,7 @@
filp->f_flags = saved_flags;
#endif
- up_read(&OCFS_I(inode)->ip_alloc_sem);
+ up_read(&OCFS2_I(inode)->ip_alloc_sem);
bail:
/* we might have to finish up extentions that were performed before
@@ -323,11 +323,11 @@
goto bail_unlock;
}
- down_read(&OCFS_I(inode)->ip_alloc_sem);
+ down_read(&OCFS2_I(inode)->ip_alloc_sem);
ret = generic_file_read (filp, buf, count, ppos);
- up_read(&OCFS_I(inode)->ip_alloc_sem);
+ up_read(&OCFS2_I(inode)->ip_alloc_sem);
if (ret == -EINVAL)
mlog(ML_ERROR, "Generic_file_read returned -EINVAL\n");
@@ -783,7 +783,7 @@
* until we're done changing it. We depend on i_sem to block
* other extend/truncate calls while we're here. Ordering wrt
* start_trans is important here -- always do it before! */
- down_write(&OCFS_I(inode)->ip_alloc_sem);
+ down_write(&OCFS2_I(inode)->ip_alloc_sem);
drop_alloc_sem = 1;
do_start_trans:
credits = ocfs_calc_extend_credits(osb->sb, fe, clusters_to_add);
@@ -900,7 +900,7 @@
leave:
if (drop_alloc_sem) {
- up_write(&OCFS_I(inode)->ip_alloc_sem);
+ up_write(&OCFS2_I(inode)->ip_alloc_sem);
drop_alloc_sem = 0;
}
if (handle) {
Modified: branches/alloc_inode/fs/ocfs2/inode.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/inode.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/inode.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -159,14 +159,6 @@
mlog_bug_on_msg(!inode, "No inode in find actor!\n");
- if (!inode->u.generic_ip) {
- mlog(ML_ERROR, "inode %lu has no generic_ip (is_bad_inode = "
- "%d)!\n", inode->i_ino, is_bad_inode(inode));
- mlog(ML_ERROR, "args-blkno = %"MLFu64", "
- "args->ino = %lu, args->flags = 0x%x\n",
- args->blkno, args->ino, args->flags);
- }
-
if (OCFS2_I(inode)->ip_blkno != args->blkno)
goto bail;
@@ -195,31 +187,6 @@
}
/*
- * ocfs_inode_init_private()
- *
- */
-int ocfs_inode_init_private(struct inode *inode)
-{
- ocfs_inode_private *i;
-
- if (!inode)
- BUG();
-
- inode->u.generic_ip = kmem_cache_alloc(ocfs2_inode_cache, GFP_NOFS);
-
- if (!inode->u.generic_ip)
- return -ENOMEM;
-
- i = inode->u.generic_ip;
- memset(i, 0, sizeof(ocfs_inode_private));
-
- init_rwsem(&i->ip_alloc_sem);
-
- i->ip_flags = OCFS_INODE_INITIALIZED;
- return 0;
-} /* ocfs_inode_init_private */
-
-/*
* ocfs_populate_inode()
*
*/
@@ -253,12 +220,6 @@
goto bail;
}
- if (!inode->u.generic_ip && ocfs_inode_init_private(inode)) {
- /* How can we recover gracefully? */
- mlog(ML_ERROR, "unable to allocate private data for inode\n");
- goto bail;
- }
-
inode->i_version = 1;
inode->i_generation = le32_to_cpu(fe->i_generation);
inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
@@ -731,11 +692,6 @@
mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL,
"Inode=%lu\n", inode->i_ino);
- if (!inode->u.generic_ip) {
- mlog(ML_ERROR, "inode %lu has no generic_ip!\n", inode->i_ino);
- goto bail;
- }
-
/* We very well may get a clear_inode before all an inodes
* metadata has hit disk. Of course, we can't drop any cluster
* locks until the journal has finished with it. */
@@ -763,8 +719,6 @@
ocfs2_lock_res_free(&oi->ip_meta_lockres);
ocfs2_lock_res_free(&oi->ip_data_lockres);
- OCFS_I(inode)->ip_flags &= ~OCFS_INODE_INITIALIZED;
-
mlog_bug_on_msg(spin_is_locked(&oi->ip_lock),
"Clear inode of %"MLFu64", inode is locked\n",
oi->ip_blkno);
@@ -774,6 +728,15 @@
oi->ip_blkno);
up(&oi->ip_io_sem);
+ /*
+ * down_trylock() returns 0, down_write_trylock() returns 1
+ * kernel 1, world 0
+ */
+ mlog_bug_on_msg(!down_write_trylock(&oi->ip_alloc_sem),
+ "Clear inode of %"MLFu64", alloc_sem is locked\n",
+ oi->ip_blkno);
+ up_write(&oi->ip_alloc_sem);
+
mlog_bug_on_msg(oi->ip_open_count,
"Clear inode of %"MLFu64" has open count %d\n",
oi->ip_blkno, oi->ip_open_count);
@@ -791,16 +754,8 @@
oi->ip_dir_start_lookup = 0;
oi->ip_blkno = 0ULL;
- /* clean out the inode private ... why?! */
- memset(inode->u.generic_ip, 0, sizeof(ocfs_inode_private));
-
bail:
- if (inode && inode->u.generic_ip) {
- kmem_cache_free(ocfs2_inode_cache, inode->u.generic_ip);
- inode->u.generic_ip = NULL;
- }
-
mlog_exit_void ();
}
Modified: branches/alloc_inode/fs/ocfs2/localalloc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/localalloc.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/localalloc.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -206,7 +206,6 @@
int status;
ocfs_journal_handle *handle = NULL;
struct inode *local_alloc_inode = NULL;
- ocfs_inode_private *oip;
struct buffer_head *bh = NULL;
struct buffer_head *main_bm_bh = NULL;
struct inode *main_bm_inode = NULL;
@@ -227,7 +226,6 @@
mlog_errno(status);
goto bail;
}
- oip = OCFS_I(local_alloc_inode);
osb->local_alloc_state = OCFS2_LA_DISABLED;
Modified: branches/alloc_inode/fs/ocfs2/namei.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/namei.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/namei.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -340,12 +340,6 @@
goto leave;
}
- if (ocfs_inode_init_private(inode)) {
- status = -ENOMEM;
- mlog_errno(status);
- goto leave;
- }
-
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
@@ -1512,14 +1506,6 @@
goto bail;
}
- if (ocfs_inode_init_private(inode)) {
- status = -ENOMEM;
- mlog_errno(status);
- iput(inode);
- inode = NULL;
- goto bail;
- }
-
credits = ocfs_calc_symlink_credits(sb);
handle = ocfs_alloc_handle(osb);
Modified: branches/alloc_inode/fs/ocfs2/ocfs.h
===================================================================
--- branches/alloc_inode/fs/ocfs2/ocfs.h 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/ocfs.h 2005-05-21 04:21:29 UTC (rev 2305)
@@ -192,23 +192,6 @@
wait_queue_head_t l_event;
} ocfs2_lock_res;
-/* OCFS2 Inode Private Data */
-typedef struct _ocfs_inode_private
-{
- /* protects allocation changes on this inode. */
- struct rw_semaphore ip_alloc_sem;
-
- u32 ip_flags; /* see below */
-} ocfs_inode_private;
-
-/* 'flags' flags. */
-/* set on init_private, cleared on clear_inode */
-/* XXX this stays until generic_ip is gone, and does not move to
- * alloc_inode() */
-#define OCFS_INODE_INITIALIZED 0x00000004
-
-#define OCFS_I(i) ((ocfs_inode_private *)(i->u.generic_ip))
-
typedef enum _ocfs_vol_state
{
VOLUME_INIT = 0,
Modified: branches/alloc_inode/fs/ocfs2/super.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/super.c 2005-05-21 03:58:10 UTC (rev 2304)
+++ branches/alloc_inode/fs/ocfs2/super.c 2005-05-21 04:21:29 UTC (rev 2305)
@@ -73,7 +73,6 @@
static u32 osb_id; /* Keeps track of next available OSB Id */
-kmem_cache_t *ocfs2_inode_cache = NULL;
kmem_cache_t *ocfs2_lock_cache = NULL;
kmem_cache_t *ocfs2_inode_cachep = NULL;
@@ -652,7 +651,6 @@
oi->ip_clusters = 0;
oi->ip_mmu_private = 0LL;
- oi->ip_flags |= OCFS_INODE_INITIALIZED;
inode_init_once(&oi->vfs_inode);
}
}
@@ -670,13 +668,6 @@
if (!ocfs2_inode_cachep)
return -ENOMEM;
- ocfs2_inode_cache = kmem_cache_create("ocfs2_inode",
- sizeof(ocfs_inode_private), 0,
- SLAB_NO_REAP|SLAB_HWCACHE_ALIGN,
- NULL, NULL);
- if (!ocfs2_inode_cache)
- return -ENOMEM;
-
ocfs2_lock_cache = kmem_cache_create("ocfs2_lock",
sizeof(ocfs_journal_lock), 0,
SLAB_NO_REAP|SLAB_HWCACHE_ALIGN,
@@ -695,12 +686,10 @@
{
if (ocfs2_inode_cachep)
kmem_cache_destroy(ocfs2_inode_cachep);
- if (ocfs2_inode_cache)
- kmem_cache_destroy(ocfs2_inode_cache);
if (ocfs2_lock_cache)
kmem_cache_destroy(ocfs2_lock_cache);
- ocfs2_inode_cache = ocfs2_lock_cache = NULL;
+ ocfs2_inode_cachep = ocfs2_lock_cache = NULL;
} /* ocfs_free_mem_caches */
static int ocfs2_sb_probe(struct super_block *sb,
More information about the Ocfs2-commits
mailing list