Skip to contentSkip to conversation

ocfs2 updates

PATCH In review Mark Fasheh 2 participants 2 messages Aug 15, 2006 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2 updates

This set of patches includes a few dlm related fixes from Kurt, and a small, trivial cleanup by Adrian.

Also included are three disk allocation patches by me - two fixes and one incremental improvement in our allocation strategy. These have been around since early June, so I think they've had enough testing that they can go upstream.

Please pull from 'upstream-linus' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git

to receive the following updates:

 fs/ocfs2/dlm/dlmmaster.c |    1 
 fs/ocfs2/dlm/dlmunlock.c |   43 +++----
 fs/ocfs2/localalloc.c    |    8 +
 fs/ocfs2/ocfs2.h         |    2 
 fs/ocfs2/suballoc.c      |  261 +++++++++++++++++++++++++++++++++++++++++------
 fs/ocfs2/suballoc.h      |    2 
 fs/ocfs2/super.c         |    8 +
 7 files changed, 263 insertions(+), 62 deletions(-)

Adrian Bunk:
fs/ocfs2/dlm/dlmmaster.c: unexport dlm_migrate_lockres

Kurt Hackel:
ocfs2: Fix lvb corruption
ocfs2: do not modify lksb->status in the unlock ast
ocfs2: fix check for locally granted state during dlmunlock()

Mark Fasheh:
ocfs2: limit cluster bitmap information saved at mount
ocfs2: better group descriptor consistency checks
ocfs2: allocation hints

fs/ocfs2/dlm/dlmmaster.c +0 -1
index 1b8346d..9503240 100644
@@ -2375,7 +2375,6 @@ leave:
 	mlog(0, "returning %d\n", ret);
 	return ret;
 }
-EXPORT_SYMBOL_GPL(dlm_migrate_lockres);
 
 int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock)
 {
fs/ocfs2/dlm/dlmunlock.c +18 -25

132 lines not on this page · raw message

fs/ocfs2/localalloc.c +8 -0
index 0d1973e..1f17a4d 100644
@@ -840,6 +840,12 @@ static int ocfs2_local_alloc_new_window(
 
 	mlog(0, "Allocating %u clusters for a new window.\n",
 	     ocfs2_local_alloc_window_bits(osb));
+
+	/* Instruct the allocation code to try the most recently used
+	 * cluster group. We'll re-record the group used this pass
+	 * below. */
+	ac->ac_last_group = osb->la_last_gd;
+
 	/* we used the generic suballoc reserve function, but we set
 	 * everything up nicely, so there's no reason why we can't use
 	 * the more specific cluster api to claim bits. */
@@ -852,6 +858,8 @@ static int ocfs2_local_alloc_new_window(
 		goto bail;
 	}
 
+	osb->la_last_gd = ac->ac_last_group;
+
 	la->la_bm_off = cpu_to_le32(cluster_off);
 	alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count);
 	/* just in case... In the future when we find space ourselves,
fs/ocfs2/ocfs2.h +1 -1
index cd4a6f2..0462a7f 100644
@@ -197,7 +197,6 @@ struct ocfs2_super
 	struct ocfs2_node_map recovery_map;
 	struct ocfs2_node_map umount_map;
 
-	u32 num_clusters;
 	u64 root_blkno;
 	u64 system_dir_blkno;
 	u64 bitmap_blkno;
@@ -237,6 +236,7 @@ struct ocfs2_super
 
 	enum ocfs2_local_alloc_state local_alloc_state;
 	struct buffer_head *local_alloc_bh;
+	u64 la_last_gd;
 
 	/* Next two fields are for local node slot recovery during
 	 * mount. */
fs/ocfs2/suballoc.c +228 -33

381 lines not on this page · raw message

fs/ocfs2/suballoc.h +2 -0
index a76c82a..c787838 100644
@@ -49,6 +49,8 @@ #define OCFS2_AC_USE_META  4
 	u16    ac_chain;
 	int    ac_allow_chain_relink;
 	group_search_t *ac_group_search;
+
+	u64    ac_last_group;
 };
 
 void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac);
fs/ocfs2/super.c +6 -2
index 382706a..d17e33e 100644
@@ -1442,8 +1442,13 @@ static int ocfs2_initialize_super(struct
 
 	osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
 
+	/* We don't have a cluster lock on the bitmap here because
+	 * we're only interested in static information and the extra
+	 * complexity at mount time isn't worht it. Don't pass the
+	 * inode in to the read function though as we don't want it to
+	 * be put in the cache. */
 	status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0,
-				  inode);
+				  NULL);
 	iput(inode);
 	if (status < 0) {
 		mlog_errno(status);
@@ -1452,7 +1457,6 @@ static int ocfs2_initialize_super(struct
 
 	di = (struct ocfs2_dinode *) bitmap_bh->b_data;
 	osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg);
-	osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total);
 	brelse(bitmap_bh);
 	mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n",
 	     (unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg);
#1 lore raw
Quoted 10 lines · Mark Fasheh

This set of patches includes a few dlm related fixes from Kurt, and a small, trivial cleanup by Adrian.

Also included are three disk allocation patches by me - two fixes and one incremental improvement in our allocation strategy. These have been around since early June, so I think they've had enough testing that they can go upstream.

Please pull from 'upstream-linus' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git

Pulled from, and pushed back out, thanks.

greg k-h