[Ocfs2-commits] mfasheh commits r854 - in trunk/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Apr 19 19:28:34 CDT 2004
Author: mfasheh
Date: 2004-04-19 18:28:32 -0500 (Mon, 19 Apr 2004)
New Revision: 854
Modified:
trunk/src/alloc.c
trunk/src/dcache.c
trunk/src/dir.c
trunk/src/dlm.c
trunk/src/file.c
trunk/src/inc/ocfs.h
trunk/src/inc/proto.h
trunk/src/inode.c
trunk/src/journal.c
trunk/src/namei.c
trunk/src/nm.c
trunk/src/oin.c
trunk/src/osb.c
trunk/src/super.c
trunk/src/util.c
Log:
* get rid of the last remnants of ocfs_inode. It is no more.
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/alloc.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -1169,13 +1169,9 @@
bool UpdateParent = false;
__u64 newExtentOff, up_ptr;
ocfs_file_entry * FileEntry = NULL;
- ocfs_inode *oin = NULL;
LOG_ENTRY_ARGS("(actualDiskOffset=%u.%u, actualLength=%u.%u)\n", actualDiskOffset, actualLength);
- if (inode)
- oin = GET_INODE_OIN(inode);
-
FileEntry = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(fe_bh); /* write */
OCFS_ASSERT (FileEntry);
@@ -2475,13 +2471,11 @@
__s64 localVbo;
__u64 cnt;
__u32 NumIndex;
- ocfs_inode *oin = NULL;
LOG_ENTRY ();
OCFS_ASSERT (osb);
OCFS_ASSERT (inode);
- oin = GET_INODE_OIN(inode);
if (INODE_JOURNAL(inode) || Vbo < OCFS_I(inode)->alloc_size) {
if (ocfs_lookup_extent_map_entry (osb, &(OCFS_I(inode)->map),
Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/dcache.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -42,15 +42,11 @@
#endif
{
int tmpstat, ret = 0; /* if all else fails, just return false */
- ocfs_file_entry *fe = NULL;
struct inode *inode;
- ocfs_inode *oin;
ocfs_super *osb;
__u64 off;
- struct qstr q;
- struct buffer_head *fe_bh = NULL;
int needs_trunc;
- ocfs_find_inode_args args;
+ ocfs_lock_res *lockres = NULL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
int flags = nd ? nd->flags : 0;
#endif
@@ -77,80 +73,40 @@
}
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER)
- goto bail;
-
- /* check for oin */
- if (inode_data_is_oin (inode)) {
- ocfs_lock_res *lockres = NULL;
- ret = 1; /* with an oin we cannot fail revalidate */
- oin = GET_INODE_OIN(inode);
-
- if (ocfs_lookup_sector_node (osb, GET_INODE_FEOFF(inode), &lockres)==0) {
- /* if I hold cache lock, no revalidate needed */
- if (lockres->lock_type == OCFS_DLM_ENABLE_CACHE_LOCK &&
- lockres->master_node_num == osb->node_num) {
- ocfs_put_lockres (lockres);
- goto bail;
- } else
- ocfs_put_lockres (lockres);
- }
- /* hit the disk */
- /* TODO: optimize */
- ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
- OCFS_I(inode)->needs_verification = true;
- tmpstat = ocfs_verify_update_inode(osb, inode, &needs_trunc);
- if (tmpstat < 0)
- LOG_ERROR_STATUS (tmpstat);
- ocfs_up_sem (&(OCFS_I(inode)->main_res));
- if (needs_trunc)
- ocfs_truncate_inode_pages(inode, 0);
goto bail;
- }
off = GET_INODE_FEOFF(inode);
if (!off) {
/* icky failure case */
- LOG_TRACE_ARGS("icky failure case, ino = %lu\n", inode->i_ino);
+ LOG_ERROR_ARGS("icky failure case! i_ino = %lu\n",
+ inode->i_ino);
goto bail;
}
- tmpstat= ocfs_read_bh(osb, off, &fe_bh, 0, inode);
- if (tmpstat < 0) {
- LOG_ERROR_STATUS(tmpstat);
- goto bail;
- }
+ ret = 1; /* with an oin we cannot fail revalidate */
- fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(fe_bh); /* read */
-
- /* we now have a file entry to call read_inode */
- q.name = fe->filename;
- q.len = strlen(fe->filename);
- if (fe->sync_flags & OCFS_SYNC_FLAG_MARK_FOR_DELETION ||
- fe->sync_flags & OCFS_SYNC_FLAG_NAME_DELETED ||
- fe->sync_flags & OCFS_SYNC_FLAG_DELETED ||
- ocfs_compare_qstr(&dentry->d_name, &q) != 0) {
- LOG_TRACE_STR("found the file entry, but it has been deleted or renamed!");
- ret = 0; /* it is now officially stale :) */
- } else {
- args.offset = fe->this_sector;
- args.fe_bh = fe_bh;
- args.skip_bind = 1;
- OCFS_BH_PUT_DATA(fe_bh);
- fe = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- ocfs_read_locked_inode (inode, &args);
-#else
- ocfs_read_inode2 (inode, (void *) &args);
-#endif
- ret = 1;
+ if (ocfs_lookup_sector_node (osb, off, &lockres)==0) {
+ /* if I hold cache lock, no revalidate needed */
+ if (lockres->lock_type == OCFS_DLM_ENABLE_CACHE_LOCK &&
+ lockres->master_node_num == osb->node_num) {
+ ocfs_put_lockres (lockres);
+ goto bail;
+ } else
+ ocfs_put_lockres (lockres);
}
+ /* hit the disk */
+ /* TODO: optimize */
+ ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
+ OCFS_I(inode)->needs_verification = true;
+ tmpstat = ocfs_verify_update_inode(osb, inode, &needs_trunc);
+ if (tmpstat < 0)
+ LOG_ERROR_STATUS (tmpstat);
+ ocfs_up_sem (&(OCFS_I(inode)->main_res));
+ if (needs_trunc)
+ ocfs_truncate_inode_pages(inode, 0);
+
bail:
- if (fe_bh) {
- if (fe)
- OCFS_BH_PUT_DATA(fe_bh);
- brelse(fe_bh);
- }
LOG_EXIT_LONG (ret);
return ret;
Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/dir.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -46,7 +46,6 @@
int pos;
struct super_block *sb;
ocfs_super *osb;
- ocfs_inode *oin;
ocfs_file *ofile;
struct buffer_head *entry_bh = NULL;
ocfs_file_entry *entry = NULL;
@@ -65,10 +64,7 @@
}
osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
- if (!ocfs_linux_get_inode_offset (inode, &rootOff, &oin)) {
- LOG_TRACE_STR ("Inode has no OIN");
- goto bail;
- }
+ rootOff = GET_INODE_VOTEOFF(inode);
if (!S_ISDIR (inode->i_mode)) {
LOG_TRACE_STR ("Not a dir");
Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/dlm.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -939,13 +939,10 @@
ocfs_lock_res *lockres = NULL;
ocfs_lock_res *tmp_lockres = NULL;
bool is_dir = false;
- ocfs_inode *oin = NULL;
- LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, %u.%u, %u)\n", osb, oin,
+ LOG_ENTRY_ARGS ("(0x%08x, %u.%u, %u)\n", osb,
HI (lock_id), LO (lock_id), flags);
- oin = GET_INODE_OIN(inode);
-
is_dir = (flags & OCFS_OIN_DIRECTORY) ? true : false;
/* Check the lock state on the disk / in our resource map */
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/file.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -27,7 +27,7 @@
#include "inc/ocfs.h"
#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_FILE
-static int ocfs_change_file_attrib (ocfs_super * osb, __u64 parent_off, ocfs_inode * oin, __u64 file_size, __u64 file_off, struct iattr *attr, struct inode *inode);
+static int ocfs_change_file_attrib (ocfs_super * osb, __u64 parent_off, __u64 file_size, __u64 file_off, struct iattr *attr, struct inode *inode);
static int ocfs_truncate_file (ocfs_super * osb, __u64 file_off, __u64 file_size, struct inode *inode);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -87,30 +87,20 @@
*/
int ocfs_file_open (struct inode *inode, struct file *file)
{
- struct dentry *dentry = file->f_dentry;
- struct inode *parent = dentry->d_parent->d_inode;
int ret =0, err = 0, status = 0;
int mode = file->f_flags;
ocfs_super *osb = NULL;
- ocfs_inode *ParentOin = NULL;
- ocfs_inode *oin = NULL;
bool bAcquiredOIN = false;
bool bClearInUse = false;
struct buffer_head *fe_bh = NULL;
- __u64 parent_off;
ocfs_sem *oin_sem = NULL;
int truncate_pages = 0;
LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", inode, file,
file->f_dentry->d_name.len, file->f_dentry->d_name.name);
- osb = (ocfs_super *) OCFS_GENERIC_SB_P(parent->i_sb);
+ osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
- if (!ocfs_linux_get_inode_offset (parent, &parent_off, &ParentOin)) {
- LOG_ERROR_STATUS (status = -ENOENT);
- goto leave;
- }
-
if (osb->osb_flags & OCFS_OSB_FLAGS_SHUTDOWN) {
LOG_ERROR_STR ("Volume has been shutdown");
status = -EACCES;
@@ -120,7 +110,6 @@
/* kch - for an open request we are already given the
* inode, and therefore we are given the oin too */
down(&inode->i_sem);
- oin = GET_INODE_OIN(inode);
oin_sem = &(OCFS_I(inode)->main_res);
ocfs_down_sem (oin_sem, true);
bAcquiredOIN = true;
@@ -133,9 +122,9 @@
bClearInUse = true;
} else {
if (OCFS_I(inode)->oin_flags & OCFS_OIN_IN_TEARDOWN)
- LOG_ERROR_ARGS ("oin (%p) in teardown", oin);
+ LOG_ERROR_STR ("oin in teardown");
else
- LOG_ERROR_ARGS ("oin (%p) deleted", oin);
+ LOG_ERROR_STR ("oin deleted");
up(&inode->i_sem);
goto leave;
}
@@ -233,8 +222,6 @@
/* where the voting thread can vote and we have an open in */
/* progress */
OCFS_CLEAR_FLAG (OCFS_I(inode)->oin_flags, OCFS_OIN_IN_USE);
- if (ParentOin)
- OCFS_CLEAR_FLAG (OCFS_I(parent)->oin_flags, OCFS_OIN_IN_USE);
if (bAcquiredOIN) {
ocfs_up_sem (oin_sem);
@@ -291,9 +278,8 @@
ocfs_bh_sem_hash_cleanup_pid(ocfs_getpid());
LOG_TRACE_ARGS
- ("exiting file_open: file=%p dentry=%p inode=%p oin=%p kiovec=%d\n",
- file, file->f_dentry, file->f_dentry->d_inode,
- GET_INODE_OIN(file->f_dentry->d_inode), err);
+ ("exiting file_open: file=%p dentry=%p inode=%p kiovec=%d\n",
+ file, file->f_dentry, file->f_dentry->d_inode, err);
LOG_EXIT_LONG (ret);
return ret;
} /* ocfs_file_open */
@@ -306,7 +292,6 @@
{
ocfs_file *ofile = NULL;
ocfs_super * osb;
- ocfs_inode *oin = NULL;
struct dentry *dentry;
bool last_close = false;
@@ -344,8 +329,6 @@
goto bail;
}
- oin = GET_INODE_OIN(inode);
-
ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
OCFS_I(inode)->open_hndl_cnt--;
if (!OCFS_I(inode)->open_hndl_cnt)
@@ -440,7 +423,7 @@
/* ocfs_change_file_attrib()
*
*/
-static int ocfs_change_file_attrib (ocfs_super * osb, __u64 parent_off, ocfs_inode * oin, __u64 file_size, __u64 file_off, struct iattr *attr, struct inode *inode)
+static int ocfs_change_file_attrib (ocfs_super * osb, __u64 parent_off, __u64 file_size, __u64 file_off, struct iattr *attr, struct inode *inode)
{
int status = 0;
int tmpstat;
@@ -579,7 +562,6 @@
{
int ret = 0;
int saAcquired = false, writingAtEOF = false;
- ocfs_inode *oin = NULL;
ocfs_super *osb = NULL;
struct inode *inode = filp->f_dentry->d_inode;
int status;
@@ -597,12 +579,11 @@
goto bail;
}
- if (!inode || !inode_data_is_oin (inode)) {
- LOG_TRACE_STR ("bad inode or inode has no oin");
+ if (!inode) {
+ LOG_TRACE_STR ("bad inode");
ret = -EIO;
goto bail;
}
- oin = GET_INODE_OIN(inode);
osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
lockres = OCFS_I(inode)->lock_res;
@@ -755,7 +736,6 @@
ssize_t ocfs_file_read (struct file *filp, char *buf, size_t count, loff_t * ppos)
{
int ret = 0;
- ocfs_inode *oin = NULL;
ocfs_super *osb = NULL;
struct inode *inode = filp->f_dentry->d_inode;
int status = 0, needs_trunc = 0;
@@ -764,12 +744,11 @@
filp->f_dentry->d_name.len, filp->f_dentry->d_name.name);
- if (!inode || !inode_data_is_oin (inode)) {
+ if (!inode) {
LOG_ERROR_STR ("Bad inode or inode has no oin");
ret = -EINVAL;
goto bail;
}
- oin = GET_INODE_OIN(inode);
osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
if (filp->f_flags & O_DIRECT) {
@@ -836,7 +815,6 @@
struct buffer_head *bh = NULL;
int flags = 0;
ocfs_journal_handle *handle = NULL;
- ocfs_inode *oin = NULL;
LOG_ENTRY_ARGS ("(file_off = %u.%u, file_size = %u.%u\n",
HILO(file_off), HILO(file_size));
@@ -891,34 +869,10 @@
goto leave;
}
- /* if oin {
- take oin->main_res
- take fe bh lock
- make file and alloc _size changes
- release bh lock
- drop oin->mani_res
- } else {
- take fe bh lock
- make file and alloc _size changes
- release bh lock
- recheck inode to see if we have oin now
- if we have it now {
- take oin->main_res
- drop oin->mani_res
- }
- }
- */
+ ocfs_down_sem(&OCFS_I(inode)->main_res, true);
- /* alright, we're going to try to get the oin at least twice
- * in this function if it hasn't already been passed to
- * us.. This is our first try... */
- oin = GET_INODE_OIN(inode);
-
- if (oin)
- ocfs_down_sem(&OCFS_I(inode)->main_res, true);
-
fe = (ocfs_file_entry *)OCFS_BH_GET_DATA_WRITE(bh); /* write */
-
+
/* the file entry might have changed underneath us (while
* waiting on the lock). make sure the size is still a valid
* one. This really ought to check for other things too, like
@@ -928,8 +882,7 @@
"to size (%u.%u)!\n", HILO(fe->file_size),
HILO(file_size));
OCFS_BH_PUT_DATA(bh);
- if (oin)
- ocfs_up_sem(&OCFS_I(inode)->main_res);
+ ocfs_up_sem(&OCFS_I(inode)->main_res);
status = -EINVAL;
LOG_ERROR_STATUS(status);
goto leave;
@@ -941,8 +894,7 @@
status = ocfs_free_extents_for_truncate (osb, fe, handle, inode);
if (status < 0) {
OCFS_BH_PUT_DATA(bh);
- if (oin)
- ocfs_up_sem(&OCFS_I(inode)->main_res);
+ ocfs_up_sem(&OCFS_I(inode)->main_res);
LOG_ERROR_STATUS (status);
goto leave;
}
@@ -962,24 +914,15 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- if (oin)
- ocfs_up_sem(&OCFS_I(inode)->main_res);
+ ocfs_up_sem(&OCFS_I(inode)->main_res);
LOG_ERROR_STATUS (status);
goto leave;
}
- /* second try for the oin... */
- if (!oin && inode_data_is_oin(inode)) {
- oin = GET_INODE_OIN(inode);
- ocfs_down_sem(&OCFS_I(inode)->main_res, true);
- }
+ /* if we updated correctly then we can update the alloc_size */
+ OCFS_I(inode)->alloc_size = new_alloc_size;
+ ocfs_up_sem (&(OCFS_I(inode)->main_res));
- if (oin) {
- /* if we updated correctly then we can update the OIN */
- OCFS_I(inode)->alloc_size = new_alloc_size;
- ocfs_up_sem (&(OCFS_I(inode)->main_res));
- }
-
leave:
if (handle && (status == 0))
ocfs_commit_trans(handle);
@@ -1035,15 +978,12 @@
struct buffer_head *bh = NULL;
int flags = 0;
ocfs_journal_handle *handle = NULL;
- ocfs_inode *oin = NULL;
LOG_ENTRY ();
if (!inode)
BUG();
- oin = GET_INODE_OIN(inode);
-
if (file_size == 0)
goto leave;
@@ -1175,8 +1115,6 @@
}
}
- /* note: ok if oin is null here, not used in
- * ocfs_allocate_extent */
status = ocfs_allocate_extent (osb, bh, handle,
actualDiskOffset, actualLength, inode);
if (status < 0) {
@@ -1189,11 +1127,9 @@
/* update the total allocation size here */
fileEntry->alloc_size += actualLength;
- if (oin) {
- ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
- OCFS_I(inode)->alloc_size = fileEntry->alloc_size;
- ocfs_up_sem (&(OCFS_I(inode)->main_res));
- }
+ ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
+ OCFS_I(inode)->alloc_size = fileEntry->alloc_size;
+ ocfs_up_sem (&(OCFS_I(inode)->main_res));
/* no need to do OCFS_SECTOR_ALIGN once the allocation size is correct. */
DISK_LOCK_SEQNUM (fileEntry) = 0;
@@ -1223,8 +1159,6 @@
goto leave;
}
- /* Update all open oins */
-
/* Our local update is done, if somebody had asked for a bdcast lock */
/* He shd set the state */
@@ -1281,7 +1215,6 @@
int error = 0;
__u64 newsize;
int status;
- ocfs_inode *oin = NULL;
ocfs_super *osb = NULL;
__u64 parentOff, fileOff;
struct super_block *sb = inode->i_sb;
@@ -1337,11 +1270,8 @@
goto bail;
/* get the file and parent offsets, and the file oin if present */
- if (!ocfs_linux_get_inode_offset (inode, &fileOff, &oin) ||
- !ocfs_linux_get_inode_offset (parentInode, &parentOff, NULL)) {
- LOG_ERROR_STR ("error getting inode offset");
- goto bail;
- }
+ fileOff = GET_INODE_VOTEOFF(inode);
+ parentOff = GET_INODE_VOTEOFF(parentInode);
if (attr->ia_valid & ATTR_SIZE) {
ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
@@ -1375,15 +1305,13 @@
goto bail;
}
- if (oin != NULL) {
- ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
- if (inode->i_size > newsize) {
- ocfs_delete_all_extent_maps(osb, inode);
- }
- inode->i_size = newsize;
- inode->i_blocks = (newsize + sb->s_blocksize) >> sb->s_blocksize_bits;
- ocfs_up_sem (&(OCFS_I(inode)->main_res));
+ ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
+ if (inode->i_size > newsize) {
+ ocfs_delete_all_extent_maps(osb, inode);
}
+ inode->i_size = newsize;
+ inode->i_blocks = (newsize + sb->s_blocksize) >> sb->s_blocksize_bits;
+ ocfs_up_sem (&(OCFS_I(inode)->main_res));
}
/* if directory, put FILE_ENTRY ptr into fileOff */
@@ -1392,7 +1320,7 @@
status = -EFAIL;
if ((fileOff != -1) && !extended) {
- status = ocfs_change_file_attrib(osb, parentOff, NULL, newsize,
+ status = ocfs_change_file_attrib(osb, parentOff, newsize,
fileOff, attr, inode);
if (status < 0) {
if (status != -EINTR)
@@ -1466,9 +1394,7 @@
*/
int ocfs_getattr (struct dentry *dentry, struct iattr *attr)
{
- ocfs_inode *oin;
struct inode *inode;
- struct super_block *sb = dentry->d_inode->i_sb;
int status, needs_trunc = 0;
ocfs_super *osb;
@@ -1476,12 +1402,11 @@
dentry->d_name.len, dentry->d_name.name);
inode = dentry->d_inode;
- if (inode == NULL || !inode_data_is_oin (inode))
+ if (inode == NULL || !OCFS_I(inode)->open_hndl_cnt)
goto bail;
osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
- oin = GET_INODE_OIN(inode);
- if (oin == ((ocfs_super *)(OCFS_GENERIC_SB_P(sb)))->oin_root_dir)
+ if (inode->i_ino == OCFS_ROOT_INODE_NUMBER)
goto bail;
ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/inc/ocfs.h 2004-04-19 23:28:32 UTC (rev 854)
@@ -131,7 +131,6 @@
enum {
INVALID_REQUEST, // reply with a NO vote
UPDATE_OIN_INODE, // update both oin and inode
- UPDATE_INODE, // no oin, so only update inode
DELETE_RENAME, // delete or rename request (EX)
RELEASE_CACHE, // release a cache lock I hold
CHANGE_MASTER, // request to change master to requestor
@@ -1699,7 +1698,6 @@
}
ocfs_file;
-typedef struct _ocfs_inode ocfs_inode;
typedef struct _ocfs_super ocfs_super;
typedef struct _ocfs_io_runs ocfs_io_runs;
typedef struct _ocfs_lock_res ocfs_lock_res;
@@ -1723,11 +1721,6 @@
__u64 sector_num; // XXX
};
-struct _ocfs_inode
-{
- int empty;
-};
-
/* OCFS2 Inode Private Data
*
* feoff/voteoff can change during rename. Luckily, rename takes a ton
@@ -1745,8 +1738,6 @@
__u64 voteoff;
__u64 feoff;
- ocfs_inode oin;
-
ocfs_sem main_res;
/* These fields are protected by main_res */
__u32 open_hndl_cnt;
@@ -1772,39 +1763,32 @@
/* is this the journal inode? */
#define OCFS_INODE_JOURNAL 0x00000002
-#define GET_INODE_CLEAN_SEQ(i) (atomic_t *)(&(OCFS_GENERIC_IP(i)->i_clean_buffer_seq))
+#define GET_INODE_CLEAN_SEQ(i) (atomic_t *)(&(OCFS_I(i)->i_clean_buffer_seq))
-#define OCFS_GENERIC_IP(i) ((ocfs_inode_private *)(i->u.generic_ip))
-#define OCFS_I(i) OCFS_GENERIC_IP(i)
+#define OCFS_I(i) ((ocfs_inode_private *)(i->u.generic_ip))
-#define INODE_DELETED(i) (OCFS_GENERIC_IP(i)->flags & OCFS_INODE_DELETED)
-#define SET_INODE_DELETED(i) (OCFS_GENERIC_IP(i)->flags |= OCFS_INODE_DELETED)
-#define CLEAR_INODE_DELETED(i) (OCFS_GENERIC_IP(i)->flags &= (~OCFS_INODE_DELETED))
+#define INODE_DELETED(i) (OCFS_I(i)->flags & OCFS_INODE_DELETED)
+#define SET_INODE_DELETED(i) (OCFS_I(i)->flags |= OCFS_INODE_DELETED)
+#define CLEAR_INODE_DELETED(i) (OCFS_I(i)->flags &= (~OCFS_INODE_DELETED))
-#define INODE_JOURNAL(i) (OCFS_GENERIC_IP(i)->flags & OCFS_INODE_JOURNAL)
-#define SET_INODE_JOURNAL(i) (OCFS_GENERIC_IP(i)->flags |= OCFS_INODE_JOURNAL)
-#define CLEAR_INODE_JOURNAL(i) (OCFS_GENERIC_IP(i)->flags &= (~OCFS_INODE_JOURNAL))
+#define INODE_JOURNAL(i) (OCFS_I(i)->flags & OCFS_INODE_JOURNAL)
+#define SET_INODE_JOURNAL(i) (OCFS_I(i)->flags |= OCFS_INODE_JOURNAL)
+#define CLEAR_INODE_JOURNAL(i) (OCFS_I(i)->flags &= (~OCFS_INODE_JOURNAL))
#define SET_INODE_VOTEOFF(i,o) \
do { \
- OCFS_GENERIC_IP(i)->voteoff = o; \
+ OCFS_I(i)->voteoff = o; \
} while (0)
-#define GET_INODE_VOTEOFF(i) OCFS_GENERIC_IP(i)->voteoff
+#define GET_INODE_VOTEOFF(i) OCFS_I(i)->voteoff
#define SET_INODE_FEOFF(i,o) \
do { \
- OCFS_GENERIC_IP(i)->feoff = o; \
+ OCFS_I(i)->feoff = o; \
} while (0)
-#define GET_INODE_FEOFF(i) OCFS_GENERIC_IP(i)->feoff
+#define GET_INODE_FEOFF(i) OCFS_I(i)->feoff
-/* callers of these next three functions should be fixed as we always
- * have oin now. */
-#define inode_data_is_oin(i) (1)
-
-#define GET_INODE_OIN(i) (&(OCFS_GENERIC_IP(i)->oin))
-
typedef enum _ocfs_vol_state
{
VOLUME_DISABLED,
@@ -1931,7 +1915,6 @@
struct list_head cache_lock_list;
struct super_block *sb;
struct inode *root_inode;
- ocfs_inode *oin_root_dir; /* ptr to the root dir ocfs_inode */
ocfs_vol_layout vol_layout;
ocfs_vol_node_map vol_node_map;
struct semaphore cfg_lock;
@@ -2551,10 +2534,6 @@
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER)
is_root = 1;
- /* add one for the oin, if necessary */
- if (inode_data_is_oin(inode) && !is_root)
- max_cnt++;
-
if (INODE_DELETED(inode))
max_cnt--;
@@ -2573,8 +2552,8 @@
return;
- LOG_ERROR_ARGS("max_cnt = %d, oin = %d, line = %u, root=%u\n", max_cnt,
- inode_data_is_oin(inode), line, is_root);
+ LOG_ERROR_ARGS("max_cnt = %d, line = %u, root=%u\n", max_cnt, line,
+ is_root);
if (dentry)
LOG_ERROR_ARGS("eek! i_count=%d, i_state=%d, i_ino=%d, name='%*s'\n",
inode->i_count, inode->i_state, inode->i_ino,
Modified: trunk/src/inc/proto.h
===================================================================
--- trunk/src/inc/proto.h 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/inc/proto.h 2004-04-19 23:28:32 UTC (rev 854)
@@ -236,7 +236,6 @@
void ocfs_initialize_dir_node (ocfs_super * osb, ocfs_dir_node * dir_node, __u64 bitmap_off, __u64 file_off, __u32 node);
int ocfs_write_dir_node (ocfs_super * osb, struct buffer_head *bhs[], __s32 idx, struct inode *dir_inode, struct inode *file_inode);
-bool ocfs_linux_get_inode_offset (struct inode * inode, __u64 * off, ocfs_inode ** oin);
int ocfs_compare_qstr (struct qstr * s1, struct qstr * s2);
void ocfs_truncate_inode_pages(struct inode *inode, loff_t off);
Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/inode.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -34,7 +34,7 @@
static int ocfs_prepare_write (struct file *file, struct page *page, unsigned from, unsigned to);
static int ocfs_commit_write (struct file *file, struct page *page, unsigned from, unsigned to);
static int ocfs_get_block (struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create);
-static int ocfs_extend_allocation(ocfs_super *osb, ocfs_inode *oin, __u64 newsize, bool unlock, struct inode *inode);
+static int ocfs_extend_allocation(ocfs_super *osb, __u64 newsize, bool unlock, struct inode *inode);
static int ocfs_symlink_get_block (struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -178,7 +178,6 @@
int ocfs_inode_init_private(struct inode *inode)
{
ocfs_inode_private *i = NULL;
- struct _ocfs_inode *oin;
if (!inode)
BUG();
@@ -190,14 +189,13 @@
return -ENOMEM;
i = (ocfs_inode_private *) inode->u.generic_ip;
- oin = &i->oin;
memset(i, 0, sizeof(ocfs_inode_private));
i->flags = 0;
atomic_set(&i->i_clean_buffer_seq, 0);
- /* Init OIN (or old OIN) stuff. */
+ /* Init old OIN stuff. */
// oin->obj_id.type = OCFS_TYPE_OIN;
// oin->obj_id.size = sizeof (ocfs_inode);
ocfs_init_sem (&(i->main_res));
@@ -225,7 +223,6 @@
ocfs_super *osb;
__u64 offset, fe_off;
unsigned long uniq_ino;
- ocfs_inode *oin = NULL;
LOG_ENTRY_ARGS ("(0x%08x, %u, size:%u)\n", inode, mode, fe->file_size);
@@ -264,7 +261,6 @@
SET_INODE_VOTEOFF(inode, offset);
SET_INODE_FEOFF(inode, fe_off);
- oin = GET_INODE_OIN(inode);
OCFS_I(inode)->alloc_size = fe->alloc_size;
OCFS_I(inode)->inode = inode;
OCFS_I(inode)->chng_seq_num = DISK_LOCK_SEQNUM (fe);
@@ -320,11 +316,9 @@
{
struct super_block *sb;
ocfs_super *osb;
- ocfs_inode *newoin;
umode_t mode;
__u64 voteoff;
ocfs_file_entry *fe = NULL;
- ocfs_inode *oin = NULL;
struct buffer_head *bh = NULL;
LOG_ENTRY_ARGS ("(%p, %p)\n", inode, args);
@@ -360,8 +354,7 @@
SET_INODE_VOTEOFF(inode, osb->vol_layout.root_start_off);
SET_INODE_FEOFF(inode, 0);
- oin = GET_INODE_OIN(inode);
- oin->alloc_size = 0ULL;
+ OCFS_I(inode)->alloc_size = 0ULL;
OCFS_I(inode)->inode = inode;
OCFS_I(inode)->chng_seq_num = 0ULL;
OCFS_I(inode)->oin_flags |= OCFS_OIN_DIRECTORY | OCFS_OIN_ROOT_DIRECTORY;
@@ -393,8 +386,6 @@
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(bh);
- newoin = NULL;
-
mode = fe->prot_bits;
switch (fe->attribs) {
case OCFS_ATTRIB_DIRECTORY:
@@ -422,7 +413,7 @@
mode |= S_IFREG;
break;
}
- ocfs_populate_inode (inode, fe, mode, newoin, false);
+ ocfs_populate_inode (inode, fe, mode, NULL, false);
voteoff = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
if (!args->skip_bind)
@@ -452,7 +443,6 @@
struct super_block *sb;
ocfs_find_inode_args *args = NULL;
ocfs_super *osb;
- ocfs_inode *oin = NULL;
umode_t mode;
ocfs_file_entry *fe = NULL;
__u64 voteoff;
@@ -493,7 +483,6 @@
SET_INODE_VOTEOFF(inode, osb->vol_layout.root_start_off);
SET_INODE_FEOFF(inode, 0);
- oin = GET_INODE_OIN(inode);
OCFS_I(inode)->alloc_size = 0ULL;
OCFS_I(inode)->inode = inode;
OCFS_I(inode)->chng_seq_num = 0ULL;
@@ -707,15 +696,11 @@
void ocfs_put_inode (struct inode *inode)
{
ocfs_super *osb;
- ocfs_inode *oin = NULL;
LOG_ENTRY_ARGS ("(0x%08x, inode_i_ino=%lu)\n", inode, inode->i_ino);
LOG_TRACE_ARGS ("put_inode: count=%d\n", inode->i_count);
osb = OCFS_GENERIC_SB_P(inode->i_sb);
- if (inode_data_is_oin(inode))
- oin = GET_INODE_OIN(inode);
-
/* Ok, if after this iput we would be the last holder of the
* root inode, then we know we're unmounting so just dump it
* now. */
@@ -755,7 +740,6 @@
__u64 offset = 0;
ocfs_super *osb;
ocfs_lock_res *lockres = NULL;
- ocfs_inode *oin;
LOG_ENTRY();
@@ -770,11 +754,9 @@
/* we should not really be using osb in this context. */
osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
- if (!ocfs_linux_get_inode_offset(inode, &offset, NULL)) {
- LOG_ERROR_ARGS("Could not find offset for inode %lu\n",
- inode->i_ino);
- goto bail;
- }
+ offset = GET_INODE_VOTEOFF(inode);
+ if (offset == -1)
+ BUG();
/* offset == 0 if this inode is newly created and hasn't been
* filled in yet. */
@@ -783,8 +765,6 @@
goto bail;
}
- oin = GET_INODE_OIN(inode);
-
if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
LOG_TRACE_STR("this is the root inode, doing cleanup now!");
ocfs_sync_blockdev(inode->i_sb);
@@ -815,8 +795,8 @@
ocfs_del_sem (&(OCFS_I(inode)->main_res));
OCFS_CLEAR_FLAG (OCFS_I(inode)->oin_flags, OCFS_INITIALIZED_MAIN_RESOURCE);
- /* clean out the oin ... why?! */
- memset(oin, 0, sizeof(ocfs_inode));
+ /* clean out the inode private ... why?! */
+ memset(inode->u.generic_ip, 0, sizeof(ocfs_inode_private));
if (!ocfs_lookup_sector_node (osb, offset, &lockres)) {
if (lockres) {
@@ -921,7 +901,7 @@
* ocfs_extend_allocation()
*
*/
-static inline int ocfs_extend_allocation(ocfs_super *osb, ocfs_inode *oin, __u64 newsize, bool unlock, struct inode *inode)
+static inline int ocfs_extend_allocation(ocfs_super *osb, __u64 newsize, bool unlock, struct inode *inode)
{
int status = 0;
@@ -978,10 +958,7 @@
goto bail;
}
- if (!ocfs_linux_get_inode_offset (inode, &entryOffset, NULL)) {
- LOG_ERROR_STR ("could not get inode offset!");
- goto bail;
- }
+ entryOffset = GET_INODE_VOTEOFF(inode);
status = ocfs_read_bh (osb, entryOffset, &bh, OCFS_BH_CACHED, inode);
if (status < 0) {
@@ -1023,7 +1000,6 @@
static int ocfs_get_block (struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create)
{
int err = -EIO;
- ocfs_inode *oin = NULL;
ocfs_super *osb = NULL;
__s64 vbo = 0;
__s64 lbo = 0;
@@ -1038,25 +1014,17 @@
goto bail;
}
- if (!inode || !inode_data_is_oin (inode)) {
- LOG_ERROR_STR ("bad inode or inode has no oin");
+ if (!inode) {
+ LOG_ERROR_STR ("bad inode");
goto bail;
}
- oin = GET_INODE_OIN(inode);
-
- if (!oin) {
- LOG_ERROR_STR("oin is NULL!");
- err = -EIO;
- goto bail;
- }
-
osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
vbo = (__s64) iblock << inode->i_sb->s_blocksize_bits;
if (!INODE_JOURNAL(inode) && vbo >= OCFS_I(inode)->alloc_size) {
LOG_TRACE_STR("Extending allocation");
- err = ocfs_extend_allocation(osb, oin, vbo+512, false, inode);
+ err = ocfs_extend_allocation(osb, vbo+512, false, inode);
if (err < 0) {
LOG_ERROR_STATUS (err);
goto bail;
@@ -1114,19 +1082,16 @@
__u32 len;
int err = 0;
struct inode *inode = mapping->host;
- ocfs_inode *oin = NULL;
LOG_ENTRY_ARGS("(block = %lu)\n", block);
- if (!inode || !inode_data_is_oin (inode)) {
- LOG_ERROR_STR ("bmap: bad inode or inode has no oin");
+ if (!inode) {
+ LOG_ERROR_STR ("bmap: bad inode");
err = -EINVAL;
LOG_ERROR_STATUS(err);
goto bail;
}
- oin = GET_INODE_OIN(inode);
-
if (!INODE_JOURNAL(inode)) {
LOG_ERROR_STR("bmap is only for journal inodes!");
err = -EINVAL;
@@ -1173,20 +1138,18 @@
static int ocfs_get_block2 (struct inode *inode, long iblock, long *oblock, int len)
{
int err = -EIO;
- ocfs_inode *oin;
ocfs_super *osb;
__s64 vbo = 0;
__s64 lbo = 0;
LOG_ENTRY_ARGS ("(0x%08x, %d)\n", inode, iblock);
- if (!inode || !inode_data_is_oin (inode)) {
- LOG_ERROR_STR ("bad inode or inode has no oin");
+ if (!inode) {
+ LOG_ERROR_STR ("bad inode");
err = -1;
goto bail;
}
- oin = GET_INODE_OIN(inode);
osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
vbo = (__s64) iblock << inode->i_sb->s_blocksize_bits;
@@ -1286,7 +1249,6 @@
int ret = -1;
int status;
ocfs_super *osb = NULL;
- ocfs_inode *oin = NULL;
__s64 vbo; /* file offset */
__s64 lbo; /* logical (disk) offset */
__s64 vbo_max; /* file offset, max_blocks from iblock */
@@ -1299,12 +1261,7 @@
LOG_ERROR_STR("ocfs_direct_IO_get_blocks: inode or bh_result is null");
return -EIO;
}
- if (!inode_data_is_oin(inode)) {
- LOG_ERROR_STR("ocfs_direct_IO_get_blocks: inode has no oin\n");
- return -EIO;
- }
- oin = GET_INODE_OIN(inode);
osb = (ocfs_super *) inode->i_sb->s_fs_info;
blocksize_bits = inode->i_sb->s_blocksize_bits;
/* make sure we're up to date... */
@@ -1329,10 +1286,10 @@
/* NOTE: create flag is set when we ?may? have to allocate some
blocks for the file. */
- if (create && vbo_max > oin->alloc_size) {
+ if (create && vbo_max > OCFS_I(inode)->alloc_size) {
/* WARNING: How much do we really want to extend the file?
is 'false' the right argument there? */
- status = ocfs_extend_allocation(osb, oin, vbo_max, false, inode);
+ status = ocfs_extend_allocation(osb, vbo_max, false, inode);
if (status < 0) {
LOG_ERROR_STR("ocfs_direct_IO_get_blocks: failed to extend the file!");
goto bail;
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/journal.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -35,7 +35,7 @@
static int ocfs_reset_publish (ocfs_super * osb, __u64 node_num);
static int ocfs_journal_release_locks(ocfs_journal_handle *handle, int abort);
static int ocfs_force_read_journal(ocfs_super *osb, __u64 size,
- ocfs_inode *oin, struct inode *inode);
+ struct inode *inode);
static int ocfs_recover_vol(struct _ocfs_super *osb, int node_num);
static int __ocfs_recovery_thread(void *arg);
#ifdef USE_JOURNAL_CREATE_REPLACEMENT
@@ -868,7 +868,6 @@
ocfs_lock_res *lockres = NULL;
__u32 cleanup_file_id = 0;
__u64 lock_id = 0;
- ocfs_inode * oin = NULL;
struct buffer_head *bh = NULL;
__u64 alloc_size;
@@ -942,7 +941,6 @@
/* we just changed this but extend_system_file doesn't know
* about oins, so we update alloc_size ourselves. */
- oin = GET_INODE_OIN(inode);
OCFS_I(inode)->alloc_size = alloc_size;
status = ocfs_create_update_lock(osb, lock_id, 0, false, inode, NULL);
if (status < 0) {
@@ -950,7 +948,7 @@
goto done;
}
OCFS_I(inode)->open_hndl_cnt++;
- LOG_TRACE_ARGS("oin->alloc_size = %u.%u\n",
+ LOG_TRACE_ARGS("inode->alloc_size = %u.%u\n",
HI(OCFS_I(inode)->alloc_size),
LO(OCFS_I(inode)->alloc_size));
@@ -1001,7 +999,6 @@
{
ocfs_journal * journal = NULL;
int status = 0;
- ocfs_inode *oin;
struct inode * inode = NULL;
int num_running_trans = 0;
@@ -1054,11 +1051,7 @@
/* Shutdown the kernel journal system */
journal_destroy(journal->k_journal);
- /* release the oin here. Isn't this racy? */
- if (inode_data_is_oin(inode)) {
- oin = GET_INODE_OIN(inode);
- OCFS_I(inode)->open_hndl_cnt--;
- }
+ OCFS_I(inode)->open_hndl_cnt--;
/* unlock our journal */
status = ocfs_release_lock (osb, journal->lock_id,
@@ -1319,7 +1312,7 @@
* size should be file_size, NOT alloc_size
*/
static int ocfs_force_read_journal(ocfs_super *osb, __u64 size,
- ocfs_inode *oin, struct inode *inode)
+ struct inode *inode)
{
int status = 0;
int i, run;
@@ -1480,7 +1473,6 @@
__u32 cleanup_file_id = 0;
ocfs_lock_res *lockres = NULL;
ocfs_file_entry *fe = NULL;
- ocfs_inode *oin = NULL;
struct inode *inode = NULL;
journal_t *k_journal = NULL;
struct buffer_head *bh = NULL;
@@ -1585,7 +1577,6 @@
fe = NULL;
- oin = GET_INODE_OIN(inode);
OCFS_I(inode)->alloc_size = alloc_size;
status = ocfs_create_update_lock(osb, lock_id, 0, false, inode, NULL);
if (status < 0) {
@@ -1593,7 +1584,7 @@
goto done;
}
- status = ocfs_force_read_journal(osb, inode->i_size, oin, inode);
+ status = ocfs_force_read_journal(osb, inode->i_size, inode);
if (status < 0) {
LOG_ERROR_STATUS(status);
goto done;
Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/namei.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -68,7 +68,6 @@
ocfs_find_inode_args args;
ocfs_file_entry *fe = NULL;
struct buffer_head *fe_bh = NULL;
- ocfs_inode *parentOin = NULL;
__u64 parentOffset, fe_off;
struct inode *inode = NULL;
struct super_block *sb = dir->i_sb;
@@ -85,11 +84,7 @@
goto bail;
}
- if (!ocfs_linux_get_inode_offset (dir, &parentOffset, &parentOin)) {
- LOG_ERROR_STR ("bad offset in parent inode");
- ret = ERR_PTR (-EACCES);
- goto bail;
- }
+ parentOffset = GET_INODE_VOTEOFF(dir);
LOG_TRACE_ARGS("about to call find_files_on_disk with inode=%08x\n", dir);
@@ -174,8 +169,6 @@
ocfs_super *osb;
ocfs_file_entry *fe = NULL;
struct buffer_head *new_fe_bh = NULL;
- ocfs_inode *ParentOin = NULL;
- ocfs_inode *oin = NULL;
struct inode *inode = NULL;
LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, %d, %d, '%*s')\n", dir, dentry, mode,
@@ -202,10 +195,7 @@
}
/* need the offset of our parent directory to lock it */
- if (!ocfs_linux_get_inode_offset (dir, &parent_off, NULL)) {
- LOG_ERROR_STATUS (status = -ENOENT);
- goto leave;
- }
+ parent_off = GET_INODE_VOTEOFF(dir);
/* start the transaction */
handle = ocfs_start_trans(osb, OCFS_MKNOD_CREDITS);
@@ -248,13 +238,7 @@
dirnode_off = fe->extents[0].disk_off;
oinflags = (S_ISDIR (mode) ? OCFS_OIN_DIRECTORY : 0);
- if (!ocfs_linux_get_inode_offset (dir, &parent_off, &ParentOin)) {
- LOG_ERROR_STATUS (status = -ENOENT);
- goto leave;
- }
-
- if (ParentOin)
- OCFS_CLEAR_FLAG (OCFS_I(dir)->oin_flags, OCFS_OIN_IN_USE);
+ parent_off = GET_INODE_VOTEOFF(dir);
ocfs_populate_inode (inode, fe, mode, NULL, true);
insert_inode_hash (inode);
@@ -264,7 +248,6 @@
OCFS_BH_PUT_DATA(new_fe_bh);
fe = NULL;
- oin = GET_INODE_OIN(inode);
status = ocfs_create_update_lock(osb, GET_INODE_VOTEOFF(inode),
oinflags, true, inode, handle);
if (status < 0)
@@ -574,7 +557,6 @@
{
int status, tmpstat;
struct inode *inode;
- ocfs_inode *oin = NULL;
int retval = -EBUSY;
ocfs_lock_res *lockres;
ocfs_super *osb = NULL;
@@ -587,13 +569,13 @@
inode = dentry->d_inode;
osb = (ocfs_super *)OCFS_GENERIC_SB_P(dir->i_sb);
- if (inode_data_is_oin (inode))
- oin = GET_INODE_OIN(inode);
- LOG_TRACE_ARGS("oin = 0x%08x\n", oin);
- ocfs_linux_get_inode_offset (dir, &parentOff, NULL);
+ parentOff = GET_INODE_VOTEOFF(dir);
fileOff = GET_INODE_FEOFF(inode);
+ if (fileOff == -1)
+ BUG();
+
LOG_TRACE_ARGS("fileOff = %u.%u, ino = %lu\n", HILO(fileOff), inode->i_ino);
status = -EBUSY;
@@ -602,10 +584,10 @@
LOG_TRACE_STR ("dentry is not empty, cannot delete");
} else if (OCFS_I(inode)->open_hndl_cnt > 0) {
LOG_TRACE_ARGS ("Cannot remove an open file (open_hndl_cnt = %u, fileOff = %u.%u, d_count=%u)\n", OCFS_I(inode)->open_hndl_cnt, HILO(fileOff), atomic_read(&dentry->d_count));
- } else if (oin && OCFS_I(inode)->oin_flags & OCFS_OIN_ROOT_DIRECTORY) {
+ } else if (OCFS_I(inode)->oin_flags & OCFS_OIN_ROOT_DIRECTORY) {
LOG_TRACE_STR ("Cannot delete the root directory");
status = -EPERM;
- } else if (oin && OCFS_I(inode)->oin_flags & OCFS_OIN_DELETE_ON_CLOSE) {
+ } else if (OCFS_I(inode)->oin_flags & OCFS_OIN_DELETE_ON_CLOSE) {
LOG_TRACE_STR ("OCFS_OIN_DELETE_ON_CLOSE set");
status = 0;
do_release = true;
@@ -630,36 +612,31 @@
OCFS_SET_FLAG (OCFS_I(inode)->oin_flags, OCFS_OIN_DELETE_ON_CLOSE);
ocfs_up_sem (&(OCFS_I(inode)->main_res));
- if (fileOff != -1)
- status = ocfs_fe_smash (osb, parentOff, 0, fileOff,
- NULL, dentry, parentInode);
+ status = ocfs_fe_smash (osb, parentOff, 0, fileOff,
+ NULL, dentry, parentInode);
if (status < 0) {
if (status != -ENOTEMPTY && status != -EPERM &&
status != -EBUSY && status != -EINTR)
LOG_ERROR_STATUS(status);
-
- if (oin) {
- ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
- OCFS_CLEAR_FLAG (OCFS_I(inode)->oin_flags, OCFS_OIN_DELETE_ON_CLOSE);
- OCFS_CLEAR_FLAG (OCFS_I(inode)->oin_flags, OCFS_OIN_IN_USE);
- ocfs_up_sem (&(OCFS_I(inode)->main_res));
- }
+
+ ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
+ OCFS_CLEAR_FLAG (OCFS_I(inode)->oin_flags, OCFS_OIN_DELETE_ON_CLOSE);
+ OCFS_CLEAR_FLAG (OCFS_I(inode)->oin_flags, OCFS_OIN_IN_USE);
+ ocfs_up_sem (&(OCFS_I(inode)->main_res));
goto bail;
}
}
if (do_release)
{
- if (!oin) {
- if (fileOff != -1) {
- tmpstat = ocfs_lookup_sector_node (osb, fileOff, &lockres);
- if (tmpstat >= 0 && lockres) {
- ocfs_remove_sector_node (osb, lockres);
- ocfs_put_lockres (lockres);
- } else
- LOG_TRACE_STR ("lookup sectornode failed\n");
- }
+ if (!OCFS_I(inode)->lock_res) {
+ tmpstat = ocfs_lookup_sector_node (osb, fileOff, &lockres);
+ if (tmpstat >= 0 && lockres) {
+ ocfs_remove_sector_node (osb, lockres);
+ ocfs_put_lockres (lockres);
+ } else
+ LOG_TRACE_STR ("lookup sectornode failed\n");
}
inode->i_nlink--;
@@ -886,7 +863,6 @@
int status = 0;
struct inode *old_inode = old_dentry->d_inode;
struct inode *new_inode = new_dentry->d_inode;
- ocfs_inode *newOIN = NULL, *oldOIN = NULL;
ocfs_file_entry *newfe = NULL, *oldfe = NULL;
struct buffer_head *oldfe_bh = NULL;
struct buffer_head *newfe_bh = NULL;
@@ -920,22 +896,20 @@
osb = (ocfs_super *) OCFS_GENERIC_SB_P(old_dir->i_sb);
/* old parent dir offset */
- ocfs_linux_get_inode_offset (old_dir, &oldDirOff, NULL);
+ oldDirOff = GET_INODE_VOTEOFF(old_dir);
/* old file offset */
- ocfs_linux_get_inode_offset (old_dentry->d_inode, &oldOffset, &oldOIN);
- if (S_ISDIR (old_dentry->d_inode->i_mode)) {
+ oldOffset = GET_INODE_VOTEOFF(old_inode);
+
+ if (S_ISDIR (old_inode->i_mode)) {
/* overwrite oldOffset to get ptr to OCFS_FILE_ENTRY
* not DIR_NODE */
- oldOffset = GET_INODE_FEOFF(old_dentry->d_inode);
+ oldOffset = GET_INODE_FEOFF(old_inode);
}
/* new parent dir offset */
newDirOff = GET_INODE_VOTEOFF (new_dir);
- if (new_dentry->d_inode != NULL && inode_data_is_oin (new_dentry->d_inode))
- newOIN = GET_INODE_OIN(new_dentry->d_inode);
-
if (new_inode) {
if (ocfs_inc_icount(new_inode) < 0)
BUG();
@@ -956,32 +930,30 @@
goto bail;
}
- if (oldOIN) {
- if (OCFS_I(old_dentry->d_inode)->open_hndl_cnt != 0) {
- status = -EBUSY;
- goto bail;
- }
- spin_lock(&oin_num_ext_lock);
- if (OCFS_I(old_dentry->d_inode)->num_extends) {
- spin_unlock(&oin_num_ext_lock);
- status = -EBUSY;
- goto bail;
- }
+ if (OCFS_I(old_inode)->open_hndl_cnt != 0) {
+ status = -EBUSY;
+ goto bail;
+ }
+ spin_lock(&oin_num_ext_lock);
+ if (OCFS_I(old_inode)->num_extends) {
spin_unlock(&oin_num_ext_lock);
+ status = -EBUSY;
+ goto bail;
}
+ spin_unlock(&oin_num_ext_lock);
/* Don't ever take the main resource for the OIN before this as */
/* Locking hierarchy will be broken */
- if (newOIN) {
- if (!(OCFS_I(new_dentry->d_inode)->oin_flags & OCFS_OIN_IN_TEARDOWN) &&
- !(OCFS_I(new_dentry->d_inode)->oin_flags & OCFS_OIN_DELETE_ON_CLOSE)) {
+ if (new_inode) {
+ if (!(OCFS_I(new_inode)->oin_flags & OCFS_OIN_IN_TEARDOWN) &&
+ !(OCFS_I(new_inode)->oin_flags & OCFS_OIN_DELETE_ON_CLOSE)) {
/* OIN exists and it's not marked for deletion! */
- ocfs_down_sem (&(OCFS_I(new_dentry->d_inode)->main_res), true);
- OCFS_SET_FLAG (OCFS_I(new_dentry->d_inode)->oin_flags,
+ ocfs_down_sem (&(OCFS_I(new_inode)->main_res), true);
+ OCFS_SET_FLAG (OCFS_I(new_inode)->oin_flags,
OCFS_OIN_IN_USE);
- status = ocfs_verify_update_inode (osb, new_dentry->d_inode, &needs_trunc);
- ocfs_up_sem (&(OCFS_I(new_dentry->d_inode)->main_res));
+ status = ocfs_verify_update_inode (osb, new_inode, &needs_trunc);
+ ocfs_up_sem (&(OCFS_I(new_inode)->main_res));
delete_target_oin = true;
if (needs_trunc)
ocfs_truncate_inode_pages(new_inode, 0);
@@ -1156,14 +1128,12 @@
/* we take oin->main_res because we want to lock out
* verify_update_oin, which reads fe_off from the
* inode, but doesn't always have i_sem. */
- if (oldOIN)
- ocfs_down_sem(&OCFS_I(old_dentry->d_inode)->main_res, true);
+ ocfs_down_sem(&OCFS_I(old_inode)->main_res, true);
status = ocfs_insert_file(osb, tmpfe, new_dir_bh, &insert_bh,
handle, old_dir, old_inode);
if (status < 0) {
- if (oldOIN)
- ocfs_up_sem(&OCFS_I(old_dentry->d_inode)->main_res);
+ ocfs_up_sem(&OCFS_I(old_inode)->main_res);
up(&old_inode->i_sem);
LOG_ERROR_STATUS (status);
goto finally;
@@ -1172,8 +1142,7 @@
status = ocfs_fix_extent_pointers(osb, handle, insert_bh,
old_inode);
if (status < 0) {
- if (oldOIN)
- ocfs_up_sem(&OCFS_I(old_dentry->d_inode)->main_res);
+ ocfs_up_sem(&OCFS_I(old_inode)->main_res);
up(&old_inode->i_sem);
LOG_ERROR_STATUS (status);
goto finally;
@@ -1182,8 +1151,8 @@
HILO(tmpfe->this_sector));
/* move the inode offset over to the new entry */
- SET_INODE_FEOFF(old_dentry->d_inode, tmpfe->this_sector);
- if (S_ISDIR(old_dentry->d_inode->i_mode)) {
+ SET_INODE_FEOFF(old_inode, tmpfe->this_sector);
+ if (S_ISDIR(old_inode->i_mode)) {
/* the vote offset doesn't actually change for
* a directory, but the fe offset does... */
ocfs_inode_rehash(&osb->inode_hash,
@@ -1191,15 +1160,14 @@
tmpfe->extents[0].disk_off,
tmpfe->this_sector);
} else {
- SET_INODE_VOTEOFF(old_dentry->d_inode,
+ SET_INODE_VOTEOFF(old_inode,
tmpfe->this_sector);
ocfs_inode_rehash(&osb->inode_hash,
tmpoff,
tmpfe->this_sector,
tmpfe->this_sector);
}
- if (oldOIN)
- ocfs_up_sem(&OCFS_I(old_dentry->d_inode)->main_res);
+ ocfs_up_sem(&OCFS_I(old_inode)->main_res);
up(&old_inode->i_sem);
} else {
/* Ok, we're moving inside of the same directory --
@@ -1228,8 +1196,8 @@
LOG_ERROR_STATUS(status);
}
- if (oldOIN && new_dentry->d_inode)
- fsync_inode_buffers(old_dentry->d_inode);
+ if (new_inode)
+ fsync_inode_buffers(old_inode);
}
old_inode->i_nlink++;
@@ -1303,7 +1271,6 @@
int ocfs_symlink (struct inode *dir, struct dentry *dentry, const char *symname)
{
ocfs_super *osb = NULL;
- ocfs_inode *oin = NULL;
struct inode *inode = NULL, *parentInode = NULL;
__u64 file_off, parent_off;
__u64 newsize;
@@ -1345,11 +1312,7 @@
osb = (ocfs_super *) OCFS_GENERIC_SB_P(dir->i_sb);
/* need the offset of our parent directory to lock it */
- if (!ocfs_linux_get_inode_offset (parentInode, &parent_off, NULL)) {
- LOG_ERROR_STR ("failed to get parent offset!");
- status = -EIO;
- goto bail;
- }
+ parent_off = GET_INODE_VOTEOFF(parentInode);
/* start the transaction */
handle = ocfs_start_trans(osb, OCFS_SYMLINK_CREDITS);
@@ -1394,7 +1357,7 @@
inode->i_rdev = OCFS_NODEV;
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(new_fe_bh); /* read */
- ocfs_populate_inode (inode, fe, S_IFLNK | S_IRWXUGO, oin, true);
+ ocfs_populate_inode (inode, fe, S_IFLNK | S_IRWXUGO, NULL, true);
OCFS_BH_PUT_DATA(new_fe_bh);
fe = NULL;
Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/nm.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -33,7 +33,7 @@
spinlock_t oin_num_ext_lock = SPIN_LOCK_UNLOCKED;
struct semaphore recovery_list_sem;
-static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, __u32 flags, int status, bool *master_alive, ocfs_inode **oin, struct inode *inode);
+static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, __u32 flags, int status, bool *master_alive, struct inode *inode);
static int ocfs_disk_update_resource (ocfs_super * osb, ocfs_lock_res * lockres, struct buffer_head **bh, __u32 timeout, struct inode *inode);
static int ocfs_search_commited(ocfs_super *osb, ocfs_lock_res *lockres);
static int ocfs_schedule_process_vote(ocfs_super *osb, struct buffer_head *bh, int vote_node);
@@ -53,7 +53,6 @@
static const char *process_vote_strings[] = {
"INVALID_REQUEST", // reply with a NO vote
"UPDATE_OIN_INODE", // update both oin and inode
- "UPDATE_INODE", // no oin, so only update inode
"DELETE_RENAME", // delete or rename request (EX)
"RELEASE_CACHE", // release a cache lock I hold
"CHANGE_MASTER", // request to change master to requestor
@@ -660,7 +659,7 @@
} /* ocfs_find_update_res */
static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num,
- __u32 flags, int status, bool *master_alive, ocfs_inode **oin, struct inode *inode)
+ __u32 flags, int status, bool *master_alive, struct inode *inode)
{
int vote_type = INVALID_REQUEST;
bool my_node_wins = false;
@@ -670,10 +669,6 @@
LOG_ENTRY_ARGS("(status=%d, lockid=%u.%u, node_num=%d, flags=%08x)\n", status,
HILO(lockid), node_num, flags);
- *oin = NULL;
- if (inode)
- *oin = GET_INODE_OIN(inode);
-
*master_alive = true;
if (status < 0) {
if (status == -ETIMEDOUT) {
@@ -711,10 +706,7 @@
else if (flags & FLAG_FILE_RELEASE_CACHE)
vote_type = RELEASE_CACHE;
else if (flags & FLAG_FILE_UPDATE_OIN) {
- if (*oin)
- vote_type = UPDATE_OIN_INODE;
- else
- vote_type = UPDATE_INODE;
+ vote_type = UPDATE_OIN_INODE;
} else if (lockres->master_node_num == osb->node_num) {
if (flags & FLAG_CHANGE_MASTER)
vote_type = CHANGE_MASTER;
@@ -735,8 +727,8 @@
done:
/* the only allowable action if we failed to */
/* get the lockres is a simple inode update */
- if (status < 0 && vote_type != UPDATE_INODE) {
- LOG_TRACE_STR("(INVALID_REQUEST) (status < 0 && vote_type != UPDATE_INODE)");
+ if (status < 0) {
+ LOG_TRACE_STR("(INVALID_REQUEST) (status < 0)");
vote_type = INVALID_REQUEST;
}
@@ -799,7 +791,6 @@
ocfs_vote *vote = NULL;
struct buffer_head *fe_bh = NULL, *vote_bh = NULL;
int vote_type = INVALID_REQUEST, vote_response = 0;
- ocfs_inode *oin = NULL;
ocfs_sem *oin_sem = NULL;
struct inode *inode = NULL;
bool master_alive = true, is_dir = false;
@@ -891,7 +882,7 @@
}
vote_type = get_process_vote_action(osb, lockres, node_num, flags,
- status, &master_alive, &oin, inode);
+ status, &master_alive, inode);
#ifdef VERBOSE_PROCESS_VOTE
printk("(%u) ocfs_process_vote: %s request for lockid: %u.%u, fe_off: %u.%u, action: (%u) %s, type: %s\n", ocfs_getpid(),
@@ -932,13 +923,6 @@
vote_response = 0;
open_handle = false;
switch (vote_type) {
- case UPDATE_INODE:
- LOG_TRACE_STR("UPDATE_INODE");
- if (inode)
- ocfs_truncate_inode_pages(inode, 0);
- vote_response = FLAG_VOTE_OIN_UPDATED;
- break;
-
case UPDATE_OIN_INODE:
LOG_TRACE_STR("UPDATE_OIN_INODE");
ocfs_down_sem (&(OCFS_I(inode)->main_res), true);
@@ -962,7 +946,7 @@
/* all cases except open_hndl_cnt > 0 will vote YES */
vote_response = FLAG_VOTE_NODE;
- if (oin) {
+ if (inode) {
oin_sem = &(OCFS_I(inode)->main_res);
ocfs_down_sem (oin_sem, true);
OCFS_I(inode)->needs_verification = true;
@@ -984,7 +968,7 @@
if (OCFS_I(inode)->open_hndl_cnt > 0) {
/* the NO vote for delete/rename */
vote_response = FLAG_VOTE_OIN_ALREADY_INUSE;
- } else if (oin) {
+ } else {
spin_lock(&oin_num_ext_lock);
if (OCFS_I(inode)->num_extends) {
vote_response = FLAG_VOTE_OIN_ALREADY_INUSE;
@@ -1021,11 +1005,10 @@
if (inode) {
inode->i_nlink = 0;
d_prune_aliases (inode);
- if (oin)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- sync_mapping_buffers(inode->i_mapping);
+ sync_mapping_buffers(inode->i_mapping);
#else
- fsync_inode_buffers (inode);
+ fsync_inode_buffers (inode);
#endif
up(&inode->i_sem);
have_i_sem = false;
@@ -1165,10 +1148,9 @@
if (vote_type == CHANGE_MASTER)
lockres->master_node_num = node_num;
-
- if (oin != NULL) {
+// if (oin != NULL) {
lockres->lock_type = OCFS_DLM_NO_LOCK;
- }
+// }
status = ocfs_read_bh(osb, lock_id, &fe_bh, lockflags, inode);
if (status < 0) {
@@ -1182,7 +1164,7 @@
if (vote_type == CHANGE_MASTER) {
OCFS_BH_PUT_DATA(fe_bh);
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_WRITE(fe_bh); /* write */
- if (oin)
+ if (OCFS_I(inode)->open_hndl_cnt)
DISK_LOCK_OIN_MAP (fe) |= (1 << osb->node_num);
DISK_LOCK_CURRENT_MASTER (fe) = node_num;
}
@@ -1190,7 +1172,7 @@
if (is_dir && vote_type == RELEASE_CACHE)
ocfs_break_cache_lock_zap_buffers(osb, inode);
-
+
/* need to do the write only if fe lock values need to change */
if (is_locked || vote_type == CHANGE_MASTER) {
if (vote_type == RELEASE_CACHE) {
@@ -1304,8 +1286,9 @@
case REMASTER_REQUESTOR:
LOG_TRACE_STR("REMASTER_REQUESTOR");
vote_response = FLAG_VOTE_NODE;
- if (oin && flags & (FLAG_FILE_EXTEND|FLAG_FILE_UPDATE) &&
- !(flags & FLAG_DIR))
+ if (inode && OCFS_I(inode)->open_hndl_cnt
+ && flags & (FLAG_FILE_EXTEND|FLAG_FILE_UPDATE)
+ && !(flags & FLAG_DIR))
open_handle = true;
break;
@@ -1320,11 +1303,11 @@
((flags & FLAG_ACQUIRE_LOCK && vote_response==FLAG_VOTE_NODE) ||
(flags & FLAG_RELEASE_LOCK))) {
- LOG_TRACE_ARGS("responding YES to %s %s request, oin=%p, node=%u\n", flags & FLAG_FILE_EXTEND ?
+ LOG_TRACE_ARGS("responding YES to %s %s request, inode=%p, node=%u\n", flags & FLAG_FILE_EXTEND ?
"extend" : "truncate", flags & FLAG_RELEASE_LOCK ?
- "release" : "acquire", oin, node_num);
+ "release" : "acquire", inode, node_num);
- if (oin && (flags & FLAG_ACQUIRE_LOCK)) {
+ if (inode && (flags & FLAG_ACQUIRE_LOCK)) {
spin_lock(&oin_num_ext_lock);
if (OCFS_I(inode)->num_extends < 0)
@@ -1352,7 +1335,7 @@
spin_unlock(&oin_num_ext_lock);
up(&recovery_list_sem);
}
- } else if (oin && (flags & FLAG_RELEASE_LOCK)) {
+ } else if (inode && (flags & FLAG_RELEASE_LOCK)) {
down(&recovery_list_sem);
spin_lock(&oin_num_ext_lock);
OCFS_I(inode)->num_extends--;
@@ -1463,7 +1446,6 @@
void ocfs_recover_oin_locks(ocfs_super *osb, __u32 node_num)
{
struct list_head *iter, *temp;
- ocfs_inode *oin;
struct inode *inode;
ocfs_inode_private *i;
@@ -1474,7 +1456,6 @@
i = list_entry (iter, ocfs_inode_private, recovery_list);
inode = i->inode;
- oin = GET_INODE_OIN(inode);
spin_lock(&oin_num_ext_lock);
if (OCFS_I(inode)->num_extends) {
Modified: trunk/src/oin.c
===================================================================
--- trunk/src/oin.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/oin.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -44,15 +44,12 @@
int disk_len;
__u64 offset;
ocfs_disk_lock dlock; /* ???: is this too much on the stack? */
- ocfs_inode *oin = NULL;
/* We are setting the oin Updated flag in the end. */
LOG_ENTRY ();
OCFS_ASSERT (inode);
- oin = GET_INODE_OIN(inode);
-
*needs_trunc = 0;
/* This read of feoff from the inode depends on all callers to
@@ -260,7 +257,6 @@
ocfs_journal_handle *handle, struct inode *inode)
{
int status = 0;
- ocfs_inode *oin;
ocfs_file_entry *fe = NULL;
bool local_handle = true;
__u32 flags = OCFS_OIN_IN_USE;
@@ -270,8 +266,6 @@
if (handle)
local_handle = false;
- oin = GET_INODE_OIN(inode);
-
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(fe_bh); /* read */
/* why do we update these here? */
@@ -326,7 +320,6 @@
int ocfs_inode_fill_ext_map(ocfs_super * osb, struct buffer_head * fe_bh, struct inode *inode)
{
int status = 0;
- ocfs_inode *oin;
int j;
__s64 tempVbo;
__s64 tempLbo;
@@ -340,7 +333,6 @@
LOG_ENTRY ();
- oin = GET_INODE_OIN(inode);
/* get a copy of fe, used readonly in this path and */
/* ocfs_create_new_oin will deadlock if fe_bh is locked */
Modified: trunk/src/osb.c
===================================================================
--- trunk/src/osb.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/osb.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -112,7 +112,6 @@
INIT_LIST_HEAD(&(osb->lock_recovery_lists[i]));
}
osb->sect_size = sect_size;
- osb->oin_root_dir = NULL;
osb->node_num = OCFS_INVALID_NODE_NUM;
memcpy (vol_layout->mount_point, vdh->mount_point, strlen (vdh->mount_point));
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/super.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -991,7 +991,6 @@
goto leave;
}
osb->root_inode = inode;
- osb->oin_root_dir = GET_INODE_OIN(inode);
/* Read the publish sector for this node and cleanup dirent being */
/* modified when we crashed. */
@@ -1041,7 +1040,6 @@
int status = 0;
bool AcquiredOSB = false;
ocfs_super *osb = NULL;
- ocfs_inode *rootoin;
__u32 nodemap;
__u32 tempmap;
int i;
@@ -1059,7 +1057,6 @@
LOG_ERROR_STATUS (status = -EFAIL);
goto leave;
}
- rootoin = osb->oin_root_dir;
/* disable any new recovery threads and wait for any currently
* running ones to exit. */
Modified: trunk/src/util.c
===================================================================
--- trunk/src/util.c 2004-04-19 18:47:39 UTC (rev 853)
+++ trunk/src/util.c 2004-04-19 23:28:32 UTC (rev 854)
@@ -253,31 +253,6 @@
#endif
} /* ocfs_linux_dbg_free */
-
-/*
- * ocfs_linux_get_inode_offset()
- *
- */
-bool ocfs_linux_get_inode_offset (struct inode * inode, __u64 * off, ocfs_inode ** oin)
-{
- if (off == NULL)
- BUG();
-
- if (oin != NULL)
- *oin = NULL;
-
- if (oin && inode_data_is_oin (inode))
- *oin = GET_INODE_OIN(inode);
- *off = GET_INODE_VOTEOFF (inode);
-
- LOG_TRACE_ARGS("offset=%u.%u, i_ino=%u\n", HILO((*off)), inode->i_ino);
-
- if (*off == -1)
- BUG();
-
- return(true);
-} /* ocfs_linux_get_inode_offset */
-
/* prefetch has been declared to allow to build in debug mode */
#ifdef DEBUG
#ifndef ARCH_HAS_PREFETCH
More information about the Ocfs2-commits
mailing list