Skip to contentSkip to conversation

GFS2] Mark inode dirty data by association

Cluster-devel Steven Whitehouse 1 participant 1 message Dec 12, 2007 GFS2 file system

lore
Share & tools
lore
#0 lore raw

From 873ffcd14f43c51b9030245e3d257679c323e164 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Tue, 11 Dec 2007 09:20:53 +0000
Subject: [PATCH] [GFS2] Mark inode dirty data by association

This adds dirty inode data to the b_assoc_buffers list so that the VFS's own metadata syning functions will see that it is associated with the inode and sync it as required. This means that this function no longer needs to be done internally by GFS2.

This is being done in preparation for future changes where we will reply on this rather than the current method.

fs/gfs2/lops.c +5 -1
index 29a8689..6b6ae8a 100644
@@ -67,6 +67,7 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
 		       struct gfs2_ail *ai)
 {
 	struct gfs2_bufdata *bd = bh->b_private;
+	struct gfs2_glock *gl = bd->bd_gl;
 
 	gfs2_assert_withdraw(sdp, buffer_uptodate(bh));
 
@@ -74,7 +75,10 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
 		gfs2_assert_withdraw(sdp, 0);
 
 	lock_buffer(bh);
-	mark_buffer_dirty(bh);
+	if (gl->gl_ops->go_type == LM_TYPE_INODE && gl->gl_object)
+		mark_buffer_dirty_inode(bh, gl->gl_object);
+	else
+		mark_buffer_dirty(bh);
 	clear_buffer_pinned(bh);
 
 	gfs2_log_lock(sdp);
Signature · 1 line
1.5.1.2