[Ocfs2-commits] mfasheh commits r901 - in trunk/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed May 5 20:08:59 CDT 2004
Author: mfasheh
Date: 2004-05-05 19:08:57 -0500 (Wed, 05 May 2004)
New Revision: 901
Modified:
trunk/src/inc/ocfs.h
trunk/src/inode.c
trunk/src/super.c
Log:
* use the fe added for the bitmap system file. Another reformat is required (use the latest ocfs-tools)
Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h 2004-05-05 22:20:27 UTC (rev 900)
+++ trunk/src/inc/ocfs.h 2004-05-06 00:08:57 UTC (rev 901)
@@ -1633,8 +1633,6 @@
#define OCFS_INODE_INITIALIZED 0x00000004
/* is this a system file? */
#define OCFS_INODE_SYSFILE 0x00000008
-/* only valid for system files. */
-#define OCFS_INODE_NOFE 0x00000010
#define GET_INODE_CLEAN_SEQ(i) (atomic_t *)(&(OCFS_I(i)->i_clean_buffer_seq))
@@ -2487,7 +2485,6 @@
ocfs_find_inode_args;
#define OCFS_FIND_INODE_FLAG_SYSFILE 0x00000002
-#define OCFS_FIND_INODE_FLAG_NOFE 0x00000008
/* timeout structure taken from Ben's aio.c */
typedef struct _ocfs_timeout {
Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c 2004-05-05 22:20:27 UTC (rev 900)
+++ trunk/src/inode.c 2004-05-06 00:08:57 UTC (rev 901)
@@ -60,8 +60,6 @@
static void __ocfs_read_inode2(struct inode *inode,
ocfs_find_inode_args *args);
-static void ocfs_read_inode_nofe(ocfs_super *osb, struct inode *inode,
- __u64 voteoff);
static struct address_space_operations ocfs_aops = {
.readpage = ocfs_readpage,
@@ -170,7 +168,6 @@
goto bail;
}
/* If we fall through here, then it's mount time! */
- printk("ocfs_iget: gonna create the root inode\n");
}
/* This shouldn't happen anymore. */
@@ -216,16 +213,9 @@
}
/* try to detect whether this is a system file. */
- if (feoff < osb->vol_layout.root_start_off) {
+ if (feoff < osb->vol_layout.root_start_off)
flags |= OCFS_FIND_INODE_FLAG_SYSFILE;
- /* We're not done yet. Some sysfiles (ok, currently
- * only the main bitmap sysfile) don't have a file
- * entry. Figure out whether we're one of those. */
- if (voteoff == OCFS_BITMAP_LOCK_OFFSET)
- flags |= OCFS_FIND_INODE_FLAG_NOFE;
- }
-
inode = ocfs_inode_hash_lookup(osb, voteoff, false);
if (!inode) {
/* we should put this guy in the hash now... */
@@ -495,96 +485,6 @@
} /* ocfs_read_inode() */
#endif
-/* ocfs_read_inode_nofe()
- *
- * This function is ugly. Because we haven't got any file entries to
- * look at, we have to special case every single offset.
- *
- * Right now, the only inodes this function knows about are:
- * - root inode
- * - volume bitmap inode
- */
-static void ocfs_read_inode_nofe(ocfs_super *osb, struct inode *inode,
- __u64 voteoff)
-{
- LOG_ENTRY();
-
- /* add other offsets to this 'if' as needed. */
- if (voteoff != OCFS_BITMAP_LOCK_OFFSET
- && voteoff != osb->vol_layout.root_start_off) {
- printk("ocfs2: yowzah! Asked to create an inode for offset"
- "%llu, but I haven't yet learned what to do!\n",
- voteoff);
-
- BUG();
- }
-
- if (!inode->u.generic_ip && ocfs_inode_init_private(inode)) {
- /* How can we recover gracefully? */
- LOG_ERROR_STR("unable to allocate private data for inode");
- goto bail;
- }
-
- /* Initialize common fields, then do the specific ones below. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- /* why is this different from 2.4!?!*/
- inode->i_blksize = 512;
- inode->i_blkbits = 9;
-#else
- inode->i_blksize = (__u32) osb->vol_layout.cluster_size;
- inode->i_attr_flags |= ATTR_FLAG_NOATIME;
-#endif
- inode->i_mapping->a_ops = &ocfs_aops;
- inode->i_atime = CURRENT_TIME;
- inode->i_mtime = CURRENT_TIME;
- inode->i_ctime = CURRENT_TIME;
- inode->i_flags |= S_NOATIME;
- inode->i_uid = osb->vol_layout.uid;
- inode->i_gid = osb->vol_layout.gid;
- SET_INODE_FEOFF(inode, 0);
-
- OCFS_I(inode)->inode = inode;
- OCFS_I(inode)->chng_seq_num = 0ULL;
-
- OCFS_SET_FLAG(OCFS_I(inode)->flags, OCFS_INODE_NOFE);
-
- if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
- inode->i_mode = S_IFDIR | osb->vol_layout.prot_bits;
-
- inode->i_op = &ocfs_dir_iops;
- inode->i_fop = &ocfs_dops;
- OCFS_I(inode)->oin_flags |= OCFS_OIN_DIRECTORY;
- OCFS_I(inode)->alloc_size = 0ULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- inode->i_blocks = 0;
-#else
- inode->i_blocks = OCFS_DEFAULT_DIR_NODE_SIZE;
- inode->i_size = OCFS_DEFAULT_DIR_NODE_SIZE;
-#endif
- SET_INODE_VOTEOFF(inode, osb->vol_layout.root_start_off);
- } else /* volume bitmap inode */ {
- inode->i_mode = S_IFREG | osb->vol_layout.prot_bits;
-
- /* i_op and f_op should prolly be something a bit more
- * appropriate. */
- inode->i_op = &ocfs_file_iops;
- inode->i_fop = &ocfs_fops;
- OCFS_I(inode)->oin_flags = 0;
- OCFS_I(inode)->alloc_size = ONE_MEGA_BYTE;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- inode->i_blocks = 0;
-#else
- inode->i_blocks = ONE_MEGA_BYTE / OCFS_BITMAP_CHUNK;
- inode->i_size = ONE_MEGA_BYTE;
-#endif
- SET_INODE_VOTEOFF(inode, OCFS_BITMAP_LOCK_OFFSET);
- }
-
-bail:
- LOG_EXIT();
- return;
-}
-
static void __ocfs_read_inode2(struct inode *inode, ocfs_find_inode_args *args)
{
struct super_block *sb;
@@ -615,11 +515,6 @@
sysfile = (args->flags & OCFS_FIND_INODE_FLAG_SYSFILE);
skip_bind = args->skip_bind;
- if (args->flags & OCFS_FIND_INODE_FLAG_NOFE) {
- ocfs_read_inode_nofe(osb, inode, args->voteoff);
- goto skip_fe;
- }
-
/* Uhoh, they didn't give us a buffer. Read the FE off
* disk. This is safe because the kernel only does one
* read_inode2 for a new inode, and if it doesn't exist yet
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-05-05 22:20:27 UTC (rev 900)
+++ trunk/src/super.c 2004-05-06 00:08:57 UTC (rev 901)
@@ -191,11 +191,11 @@
/* Why the iputs below? Because we get an extra reference
* which we don't need (the purpose of this function is to
- * just get the system inodes in the inode hash. */
+ * just get the system inodes in the inode hash) */
/* the vol bitmap */
sys_off = OCFS_BITMAP_LOCK_OFFSET;
- new = ocfs_iget(osb, sys_off, 0, NULL);
+ new = ocfs_iget(osb, sys_off, sys_off, NULL);
if (!new) {
status = -EINVAL;
LOG_ERROR_STATUS(status);
More information about the Ocfs2-commits
mailing list