[Ocfs2-commits] jlbec commits r2260 - branches/alloc_inode/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue May 17 16:00:40 CDT 2005


Author: jlbec
Date: 2005-05-17 16:00:39 -0500 (Tue, 17 May 2005)
New Revision: 2260

Modified:
   branches/alloc_inode/fs/ocfs2/alloc.c
   branches/alloc_inode/fs/ocfs2/aops.c
   branches/alloc_inode/fs/ocfs2/dir.c
   branches/alloc_inode/fs/ocfs2/dlmglue.c
   branches/alloc_inode/fs/ocfs2/extent_map.c
   branches/alloc_inode/fs/ocfs2/file.c
   branches/alloc_inode/fs/ocfs2/inode.c
   branches/alloc_inode/fs/ocfs2/journal.c
   branches/alloc_inode/fs/ocfs2/namei.c
   branches/alloc_inode/fs/ocfs2/ocfs.h
   branches/alloc_inode/fs/ocfs2/suballoc.c
Log:

o Move ip_clusters to ocfs2_inode_info.



Modified: branches/alloc_inode/fs/ocfs2/alloc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/alloc.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/alloc.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -984,7 +984,7 @@
 	el = &(fe->id2.i_list);
 
 	spin_lock(&OCFS_I(inode)->ip_lock);
-	OCFS_I(inode)->ip_clusters = fe->i_clusters - clusters_to_del;
+	OCFS2_I(inode)->ip_clusters = fe->i_clusters - clusters_to_del;
 	spin_unlock(&OCFS_I(inode)->ip_lock);
 	fe->i_clusters -= clusters_to_del;
 	fe->i_mtime = CURRENT_TIME.tv_sec;

Modified: branches/alloc_inode/fs/ocfs2/aops.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/aops.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/aops.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -155,7 +155,7 @@
 	spin_lock(&OCFS_I(inode)->ip_lock);
 	if (iblock >=
 	    ocfs2_clusters_to_blocks(inode->i_sb,
-				     OCFS_I(inode)->ip_clusters)) {
+				     OCFS2_I(inode)->ip_clusters)) {
 		spin_unlock(&OCFS_I(inode)->ip_lock);
 		err = -EIO;
 		goto bail;
@@ -362,7 +362,7 @@
 	spin_lock(&OCFS_I(inode)->ip_lock);
 	if ((iblock + max_blocks) >
 	    ocfs2_clusters_to_blocks(inode->i_sb,
-				     OCFS_I(inode)->ip_clusters)) {
+				     OCFS2_I(inode)->ip_clusters)) {
 		spin_unlock(&OCFS_I(inode)->ip_lock);
 		ret = -EIO;
 		goto bail;

Modified: branches/alloc_inode/fs/ocfs2/dir.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/dir.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/dir.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -336,7 +336,7 @@
 	u64 p_blkno;
 
 	spin_lock(&OCFS_I(dir)->ip_lock);
-	extend = (i_size_read(dir) == ocfs2_clusters_to_bytes(sb, OCFS_I(dir)->ip_clusters));
+	extend = (i_size_read(dir) == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters));
 	spin_unlock(&OCFS_I(dir)->ip_lock);
 
 	if (extend) {
@@ -402,7 +402,7 @@
 
 	/* dir->i_size is always block aligned. */
 	spin_lock(&OCFS_I(dir)->ip_lock);
-	if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS_I(dir)->ip_clusters)) {
+	if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) {
 		spin_unlock(&OCFS_I(dir)->ip_lock);
 		num_free_extents = ocfs_num_free_extents(osb, dir, fe);
 		if (num_free_extents < 0) {

Modified: branches/alloc_inode/fs/ocfs2/dlmglue.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/dlmglue.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/dlmglue.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -1196,13 +1196,12 @@
  * date from the truncate code. */
 static void __ocfs2_stuff_meta_lvb(struct inode *inode)
 {
-	ocfs_inode_private *oip = OCFS_I(inode);
-	ocfs2_lock_res *lockres = &oip->ip_meta_lockres;
+	ocfs2_lock_res *lockres = &OCFS_I(inode)->ip_meta_lockres;
 	ocfs2_meta_lvb *lvb     = (ocfs2_meta_lvb *) lockres->l_lksb.lvb;
 
 	mlog_entry_void();
 
-	lvb->lvb_iclusters = cpu_to_be32(oip->ip_clusters);
+	lvb->lvb_iclusters = cpu_to_be32(OCFS2_I(inode)->ip_clusters);
 	lvb->lvb_iuid      = cpu_to_be32(inode->i_uid);
 	lvb->lvb_igid      = cpu_to_be32(inode->i_gid);
 	lvb->lvb_isize     = cpu_to_be64(i_size_read(inode));
@@ -1236,14 +1235,14 @@
 
 	/* We're safe here without the lockres lock... */
 	spin_lock(&oip->ip_lock);
-	oip->ip_clusters = be32_to_cpu(lvb->lvb_iclusters);
+	OCFS2_I(inode)->ip_clusters = be32_to_cpu(lvb->lvb_iclusters);
 	inode->i_uid     = be32_to_cpu(lvb->lvb_iuid);
 	inode->i_gid     = be32_to_cpu(lvb->lvb_igid);
 	i_size_write(inode, be64_to_cpu(lvb->lvb_isize));
 	inode->i_mode    = be16_to_cpu(lvb->lvb_imode);
 	inode->i_nlink   = be16_to_cpu(lvb->lvb_inlink);
 	/* fast-symlinks are a special case */
-	if (S_ISLNK(inode->i_mode) && !oip->ip_clusters)
+	if (S_ISLNK(inode->i_mode) && !OCFS2_I(inode)->ip_clusters)
 		inode->i_blocks = 0;
 	else
 		inode->i_blocks  = ocfs2_align_bytes_to_sectors(i_size_read(inode));
@@ -1264,7 +1263,7 @@
 	mlog_entry_void();
 
 	spin_lock(&OCFS_I(inode)->ip_lock);
-	i_clusters = OCFS_I(inode)->ip_clusters;
+	i_clusters = OCFS2_I(inode)->ip_clusters;
 	spin_unlock(&OCFS_I(inode)->ip_lock);
 
 	spin_lock(&lockres->l_lock);

Modified: branches/alloc_inode/fs/ocfs2/extent_map.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/extent_map.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/extent_map.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -164,7 +164,7 @@
 
 			ret = -EBADR;
 			if ((rec->e_cpos + rec->e_clusters) >
-			    OCFS_I(inode)->ip_clusters)
+			    OCFS2_I(inode)->ip_clusters)
 				goto out_free;
 
 			if ((rec->e_cpos + rec->e_clusters) <= cpos) {
@@ -549,14 +549,14 @@
 	OCFS_ASSERT(new_clusters);
 	OCFS_ASSERT(rec->e_clusters >= new_clusters);
 
-	if (em->em_clusters < OCFS_I(inode)->ip_clusters) {
+	if (em->em_clusters < OCFS2_I(inode)->ip_clusters) {
 		/*
 		 * Size changed underneath us on disk.  Drop any
 		 * straddling records and update our idea of
 		 * i_clusters
 		 */
 		ocfs2_extent_map_drop(inode, em->em_clusters - 1);
-		em->em_clusters = OCFS_I(inode)->ip_clusters;
+		em->em_clusters = OCFS2_I(inode)->ip_clusters;
 	}
 
 	OCFS_ASSERT((rec->e_cpos + rec->e_clusters) ==
@@ -620,7 +620,7 @@
 
 	*rec = NULL;
 
-	if (cpos >= OCFS_I(inode)->ip_clusters)
+	if (cpos >= OCFS2_I(inode)->ip_clusters)
 		return -EINVAL;
 
 	if (cpos >= em->em_clusters) {
@@ -630,7 +630,7 @@
 		 * i_clusters
 		 */
 		ocfs2_extent_map_drop(inode, em->em_clusters - 1);
-		em->em_clusters = OCFS_I(inode)->ip_clusters ;
+		em->em_clusters = OCFS2_I(inode)->ip_clusters ;
 	}
 
 	ent = ocfs2_extent_map_lookup(&OCFS2_I(inode)->ip_map, cpos, 1,
@@ -657,7 +657,7 @@
 
 	*p_cpos = ccount = 0;
 
-	if ((v_cpos + count) > OCFS_I(inode)->ip_clusters)
+	if ((v_cpos + count) > OCFS2_I(inode)->ip_clusters)
 		return -EINVAL;
 
 	if ((v_cpos + count) > em->em_clusters) {
@@ -667,7 +667,7 @@
 		 * i_clusters
 		 */
 		ocfs2_extent_map_drop(inode, em->em_clusters - 1);
-		em->em_clusters = OCFS_I(inode)->ip_clusters;
+		em->em_clusters = OCFS2_I(inode)->ip_clusters;
 	}
 
 
@@ -714,7 +714,7 @@
 	cpos = ocfs2_blocks_to_clusters(inode->i_sb, v_blkno);
 	clusters = ocfs2_blocks_to_clusters(inode->i_sb,
 					    (u64)count + bpc - 1);
-	if ((cpos + clusters) > OCFS_I(inode)->ip_clusters)
+	if ((cpos + clusters) > OCFS2_I(inode)->ip_clusters)
 		return -EINVAL;
 
 	if ((cpos + clusters) > em->em_clusters) {
@@ -724,7 +724,7 @@
 		 * i_clusters
 		 */
 		ocfs2_extent_map_drop(inode, em->em_clusters - 1);
-		em->em_clusters = OCFS_I(inode)->ip_clusters;
+		em->em_clusters = OCFS2_I(inode)->ip_clusters;
 	}
 
 	ret = ocfs2_extent_map_lookup_read(inode, cpos, clusters, &ent);

Modified: branches/alloc_inode/fs/ocfs2/file.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/file.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/file.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -668,7 +668,7 @@
 
 	fe->i_clusters += num_bits;
 	spin_lock(&OCFS_I(inode)->ip_lock);
-	OCFS_I(inode)->ip_clusters = fe->i_clusters;
+	OCFS2_I(inode)->ip_clusters = fe->i_clusters;
 	spin_unlock(&OCFS_I(inode)->ip_lock);
 
 	status = ocfs_journal_dirty(handle, fe_bh);
@@ -899,7 +899,7 @@
 	     fe->i_clusters, fe->i_size);
 
 	mlog(0, "inode: ip_clusters=%u, i_size=%lld\n",
-	     OCFS_I(inode)->ip_clusters, i_size_read(inode));
+	     OCFS2_I(inode)->ip_clusters, i_size_read(inode));
 
 	fe->i_ctime = fe->i_mtime = CURRENT_TIME.tv_sec;
 

Modified: branches/alloc_inode/fs/ocfs2/inode.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/inode.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/inode.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -226,7 +226,6 @@
 	init_MUTEX(&(i->ip_io_sem));
 
 	/* These should be set in read_inode2. */
-	i->ip_clusters = 0;
 	i->ip_mmu_private = 0LL;
 
 	i->ip_flags |= OCFS_INODE_INITIALIZED;
@@ -297,8 +296,8 @@
 		     "ip_blkno %"MLFu64" != i_blkno %"MLFu64"!\n",
 		     OCFS2_I(inode)->ip_blkno, fe->i_blkno);
 
-	OCFS_I(inode)->ip_clusters = fe->i_clusters;
 	OCFS_I(inode)->ip_inode = inode;
+	OCFS2_I(inode)->ip_clusters = fe->i_clusters;
 	OCFS2_I(inode)->ip_orphaned_slot = OCFS_INVALID_NODE_NUM;
 
 	if (create_ino)
@@ -921,7 +920,7 @@
 	}
 
 	spin_lock(&OCFS_I(inode)->ip_lock);
-	fe->i_clusters = OCFS_I(inode)->ip_clusters;
+	fe->i_clusters = OCFS2_I(inode)->ip_clusters;
 	spin_unlock(&OCFS_I(inode)->ip_lock);
 
 	fe->i_size = (u64)i_size_read(inode);
@@ -960,7 +959,7 @@
 
 	spin_lock(&oip->ip_lock);
 
-	oip->ip_clusters = fe->i_clusters;
+	OCFS2_I(inode)->ip_clusters = fe->i_clusters;
 	i_size_write(inode, fe->i_size);
 	if (S_ISREG(inode->i_mode)) {
 		oip->ip_mmu_private = i_size_read(inode);

Modified: branches/alloc_inode/fs/ocfs2/journal.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/journal.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/journal.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -548,11 +548,11 @@
 	mlog(0, "fe->i_size = %"MLFu64"\n", fe->i_size);
 	mlog(0, "fe->i_clusters = %u\n", fe->i_clusters);
 	mlog(0, "fe->i_blkno = %"MLFu64"\n", fe->i_blkno);
-	mlog(0, "inode->ip_clusters = %u\n", OCFS_I(inode)->ip_clusters);
+	mlog(0, "inode->ip_clusters = %u\n", OCFS2_I(inode)->ip_clusters);
 
-	if (OCFS_I(inode)->ip_clusters != fe->i_clusters) 
+	if (OCFS2_I(inode)->ip_clusters != fe->i_clusters) 
 		mlog(ML_ERROR, "inode and fe alloc sizes differ! (%u != %u",
-		     OCFS_I(inode)->ip_clusters, fe->i_clusters);
+		     OCFS2_I(inode)->ip_clusters, fe->i_clusters);
 	if (inode->i_size != fe->i_size)
 		mlog(ML_ERROR, "inode and fe i_size's differ! "
 			       "(%lld != %"MLFu64")",
@@ -1104,7 +1104,7 @@
 	     node_num, slot_num, MAJOR(osb->sb->s_dev),
 	     MINOR(osb->sb->s_dev));
 
-	OCFS_I(inode)->ip_clusters = fe->i_clusters;
+	OCFS2_I(inode)->ip_clusters = fe->i_clusters;
 
 	status = ocfs_force_read_journal(inode);
 	if (status < 0) {

Modified: branches/alloc_inode/fs/ocfs2/namei.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/namei.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/namei.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -1390,7 +1390,7 @@
 		       inode->i_blocks, i_size_read(inode), blocks);
 
 	/* Sanity check -- make sure we're going to fit. */
-	if (bytes_left > ocfs2_clusters_to_bytes(sb, OCFS_I(inode)->ip_clusters)) {
+	if (bytes_left > ocfs2_clusters_to_bytes(sb, OCFS2_I(inode)->ip_clusters)) {
 		status = -EIO;
 		mlog_errno(status);
 		goto bail;

Modified: branches/alloc_inode/fs/ocfs2/ocfs.h
===================================================================
--- branches/alloc_inode/fs/ocfs2/ocfs.h	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/ocfs.h	2005-05-17 21:00:39 UTC (rev 2260)
@@ -207,7 +207,6 @@
 
 	/* These fields are protected by ip_lock */
 	spinlock_t	  ip_lock;
-	u32		ip_clusters;
 	loff_t		ip_mmu_private;
 	struct ocfs2_extent_map ip_map;
 	struct list_head ip_io_markers;

Modified: branches/alloc_inode/fs/ocfs2/suballoc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/suballoc.c	2005-05-17 19:10:08 UTC (rev 2259)
+++ branches/alloc_inode/fs/ocfs2/suballoc.c	2005-05-17 21:00:39 UTC (rev 2260)
@@ -319,7 +319,7 @@
 	}
 
 	spin_lock(&OCFS_I(alloc_inode)->ip_lock);
-	OCFS_I(alloc_inode)->ip_clusters = fe->i_clusters;
+	OCFS2_I(alloc_inode)->ip_clusters = fe->i_clusters;
 	fe->i_size = ocfs2_clusters_to_bytes(alloc_inode->i_sb,
 					     fe->i_clusters);
 	spin_unlock(&OCFS_I(alloc_inode)->ip_lock);



More information about the Ocfs2-commits mailing list