[Ocfs2-tools-devel] [PATCH 13/23] tunefs rework: Add op_set_slot_count.c

Joel Becker Joel.Becker at oracle.com
Mon Aug 11 18:10:07 PDT 2008


On Mon, Aug 11, 2008 at 05:32:05PM -0700, Joel Becker wrote:
> The set_slot_count operation changes the number of node slots on an
> ocfs2 filesystem.  Each slot has a journal and other associated files.
> The number of slots is the number of nodes that can share the
> filesystem.  All filesystems must have at least one slot.

	This is what I get for rebasing late at night.  The patch needed
an update for Tao's ocfs2_init_dir()/ocfs2_link() change.  This is the
delta.

diff --git a/tunefs.ocfs2/op_set_slot_count.c b/tunefs.ocfs2/op_set_slot_count.c
index 57e641d..207d9b0 100644
--- a/tunefs.ocfs2/op_set_slot_count.c
+++ b/tunefs.ocfs2/op_set_slot_count.c
@@ -107,12 +107,12 @@ static errcode_t add_slots(ocfs2_filesys *fs, int num_slots)
 
 			/* if dir, alloc space to it */
 			if (ftype == OCFS2_FT_DIR) {
-				ret = ocfs2_expand_dir(fs, blkno,
-						       fs->fs_sysdir_blkno);
+				ret = ocfs2_init_dir(fs, blkno,
+						     fs->fs_sysdir_blkno);
 				if (ret) {
 					verbosef(VL_APP,
-						 "%s while creating space "
-						 "for directory \"%s\"\n",
+						 "%s while initializing "
+						 "directory \"%s\"\n",
 						 error_message(ret),
 						 fname);
 					goto bail;
@@ -122,16 +122,6 @@ static errcode_t add_slots(ocfs2_filesys *fs, int num_slots)
 			/* Add the inode to the system dir */
 			ret = ocfs2_link(fs, fs->fs_sysdir_blkno, fname,
 					 blkno, ftype);
-			if (!ret)
-				goto file_done;
-
-			if (ret == OCFS2_ET_DIR_NO_SPACE) {
-				ret = ocfs2_expand_dir(fs, fs->fs_sysdir_blkno,
-						       fs->fs_sysdir_blkno);
-				if (!ret)
-					ret = ocfs2_link(fs, fs->fs_sysdir_blkno,
-							 fname, blkno, ftype);
-			}
 			if (ret) {
 				verbosef(VL_APP,
 					"%s while linking inode %"PRIu64" "
@@ -140,7 +130,6 @@ static errcode_t add_slots(ocfs2_filesys *fs, int num_slots)
 					error_message(ret), blkno, fname);
 				goto bail;
 			}
-file_done:
 			verbosef(VL_APP, "System file \"%s\" created\n",
 				 fname);
 		}
-- 

"You must remember this:
 A kiss is just a kiss,
 A sigh is just a sigh.
 The fundamental rules apply
 As time goes by."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list