[Ocfs2-commits]
jlbec commits r998 - in branches/format-changes/src: . inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jun 3 16:53:47 CDT 2004
Author: jlbec
Date: 2004-06-03 15:53:45 -0500 (Thu, 03 Jun 2004)
New Revision: 998
Modified:
branches/format-changes/src/inc/ocfs.h
branches/format-changes/src/inc/proto.h
branches/format-changes/src/inode.c
branches/format-changes/src/namei.c
Log:
o Added i_generation to the inode.
o Removed 'mode' from the arguments of ocfs_populate_inode(). It's
on fe->i_mode now.
Modified: branches/format-changes/src/inc/ocfs.h
===================================================================
--- branches/format-changes/src/inc/ocfs.h 2004-06-03 19:58:45 UTC (rev 997)
+++ branches/format-changes/src/inc/ocfs.h 2004-06-03 20:53:45 UTC (rev 998)
@@ -1322,27 +1322,27 @@
/*
* On disk file entry (inode) for OCFS v2
*/
-typedef struct _ocfs_file_entry
-{
+typedef struct _ocfs_file_entry {
/*00*/ __u8 i_signature[8]; /* Signature for validation */
- __u64 i_reserved1;
-/*10*/ ocfs_disk_lock disk_lock; /* Lock structure */
-/*30*/ __u32 i_uid; /* Owner UID */
- __u32 i_gid; /* Owning GID */
- __u64 i_size; /* Size in bytes */
-/*40*/ __u16 i_mode; /* File mode */
- __u16 i_links_count; /* Links count */
- __u32 i_flags; /* File flags */
- __u64 i_atime; /* Access time */
-/*50*/ __u64 i_ctime; /* Creation time */
- __u64 i_mtime; /* Modification time */
-/*60*/ __u64 i_dtime; /* Deletion time */
- __u64 i_blkno; /* Offset on disk, in blocks */
-/*70*/ __u32 i_clusters; /* Cluster count */
+ __u32 i_generation; /* Generation number */
__u32 i_suballoc_node; /* Node suballocater this inode
belongs to */
- __u64 i_suballoc_blkno; /* Node suballocator offset
+/*10*/ __u64 i_suballoc_blkno; /* Node suballocator offset
(in blocks) */
+/*18*/ ocfs_disk_lock disk_lock; /* Lock structure */
+/*38*/ __u32 i_uid; /* Owner UID */
+ __u32 i_gid; /* Owning GID */
+/*40*/ __u64 i_size; /* Size in bytes */
+ __u16 i_mode; /* File mode */
+ __u16 i_links_count; /* Links count */
+ __u32 i_flags; /* File flags */
+/*50*/ __u64 i_atime; /* Access time */
+ __u64 i_ctime; /* Creation time */
+/*60*/ __u64 i_mtime; /* Modification time */
+ __u64 i_dtime; /* Deletion time */
+/*70*/ __u64 i_blkno; /* Offset on disk, in blocks */
+ __u32 i_clusters; /* Cluster count */
+ __u32 i_reserved1;
/*80*/ union {
__u64 fe_private;
__u64 i_rdev;
@@ -1351,16 +1351,15 @@
__u32 total_bits;
} bitinfo;
} u;
- __u64 i_reserved2;
-/*90*/ __s16 i_tree_depth; /* Extent tree depth
+/*98*/ __s16 i_tree_depth; /* Extent tree depth
* -1 means data extents hang
* directly off of the
* file_entry.
*/
__u16 i_next_free_ext; /* Next unused extent slot */
__u32 i_reserved3;
- __u64 last_ext_ptr; /* Pointer to last extdat */
-/*A0*/ ocfs_alloc_ext extents[OCFS_MAX_FILE_ENTRY_EXTENTS]; // EXTENT[OCFS_MAX_FILE_ENTRY_EXTENTS]
+/*A0*/ __u64 last_ext_ptr; /* Pointer to last extdat */
+/*A8*/ ocfs_alloc_ext extents[OCFS_MAX_FILE_ENTRY_EXTENTS]; // EXTENT[OCFS_MAX_FILE_ENTRY_EXTENTS]
} ocfs_file_entry;
typedef struct _ocfs_extent_group // CLASS
Modified: branches/format-changes/src/inc/proto.h
===================================================================
--- branches/format-changes/src/inc/proto.h 2004-06-03 19:58:45 UTC (rev 997)
+++ branches/format-changes/src/inc/proto.h 2004-06-03 20:53:45 UTC (rev 998)
@@ -233,7 +233,7 @@
int ocfs_inode_init_private(struct inode *inode);
int ocfs_inode_revalidate(struct dentry *dentry);
void ocfs_populate_inode(struct inode *inode, ocfs_file_entry *fe,
- umode_t mode, int create_ino);
+ int create_ino);
void ocfs_put_inode(struct inode *inode);
void ocfs_read_inode(struct inode *inode);
void ocfs_read_inode2(struct inode *inode, void *opaque);
Modified: branches/format-changes/src/inode.c
===================================================================
--- branches/format-changes/src/inode.c 2004-06-03 19:58:45 UTC (rev 997)
+++ branches/format-changes/src/inode.c 2004-06-03 20:53:45 UTC (rev 998)
@@ -368,13 +368,14 @@
* ocfs_populate_inode()
*
*/
-void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode, int create_ino)
+void ocfs_populate_inode(struct inode *inode, ocfs_file_entry *fe,
+ int create_ino)
{
struct super_block *sb;
ocfs_super *osb;
__u64 offset;
- LOG_ENTRY_ARGS ("(0x%p, %u, size:%llu)\n", inode, mode, fe->i_size);
+ LOG_ENTRY_ARGS ("(0x%p, size:%llu)\n", inode, fe->i_size);
sb = inode->i_sb;
osb = OCFS_SB(sb);
@@ -395,9 +396,9 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
inode->i_version = 1;
#endif
-
+ inode->i_generation = le32_to_cpu(fe->i_generation);
inode->i_rdev = ocfs_decode_dev(le64_to_cpu(fe->u.i_rdev));
- inode->i_mode = mode;
+ inode->i_mode = fe->i_mode;
inode->i_uid = fe->i_uid;
inode->i_gid = fe->i_gid;
inode->i_blksize = (u32)osb->vol_layout.cluster_size; // sb->s_blocksize;
@@ -455,7 +456,8 @@
inode->i_size = fe->i_size;
break;
default:
- init_special_inode (inode, mode, inode->i_rdev);
+ init_special_inode(inode, inode->i_mode,
+ inode->i_rdev);
break;
}
@@ -548,7 +550,7 @@
if (S_ISCHR(fe->i_mode) || S_ISBLK(fe->i_mode))
inode->i_rdev = ocfs_decode_dev(le64_to_cpu(fe->u.i_rdev));
- ocfs_populate_inode (inode, fe, fe->i_mode, 0);
+ ocfs_populate_inode (inode, fe, 0);
/* eventually this case has to GO! */
if (feoff != (fe->i_blkno << osb->sb->s_blocksize_bits))
Modified: branches/format-changes/src/namei.c
===================================================================
--- branches/format-changes/src/namei.c 2004-06-03 19:58:45 UTC (rev 997)
+++ branches/format-changes/src/namei.c 2004-06-03 20:53:45 UTC (rev 998)
@@ -205,7 +205,7 @@
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(new_fe_bh); /* read */
- ocfs_populate_inode (inode, fe, mode, 1);
+ ocfs_populate_inode (inode, fe, 1);
insert_inode_hash (inode);
file_off = fe->i_blkno << osb->sb->s_blocksize_bits;
@@ -360,6 +360,12 @@
fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_WRITE(*new_fe_bh); /* write */
memset (fe, 0, osb->sect_size);
inode->i_ino = ino_from_off(osb->sb, disk_off);
+ /*
+ * FIXME This needs to be
+ * (node_num << 24) | (nodeconf->gen_counter++ & 0x00FFFFFF)
+ */
+ inode->i_generation = 0;
+ fe->i_generation = cpu_to_le32(inode->i_generation);
fe->i_blkno = disk_off >> osb->sb->s_blocksize_bits;
fe->i_suballoc_blkno = fileOffset >> osb->sb->s_blocksize_bits;
fe->i_suballoc_node = osb->node_num;
@@ -1341,7 +1347,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, 1);
+ ocfs_populate_inode (inode, fe, 1);
OCFS_BH_PUT_DATA(new_fe_bh);
fe = NULL;
More information about the Ocfs2-commits
mailing list