FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-20-2012, 02:09 PM
 
Default fsck.gfs2: fsck.gfs2: Find and clear duplicate leaf blocks refs

From: Bob Peterson <rpeterso@redhat.com>

Duplicate references that were in leaf blocks were never found nor
cleared. This patch adds that capability.

rhbz#675723
---
gfs2/fsck/pass1b.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index ce358c4..65e6de9 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -26,6 +26,7 @@ struct dup_handler {
int ref_count;
};

+static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
static int check_metalist(struct gfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, int h, void *private);
static int check_data(struct gfs2_inode *ip, uint64_t block, void *private);
@@ -51,7 +52,7 @@ static int find_dentry(struct gfs2_inode *ip, struct gfs2_dirent *de,

struct metawalk_fxns find_refs = {
.private = NULL,
- .check_leaf = NULL,
+ .check_leaf = check_leaf,
.check_metalist = check_metalist,
.check_data = check_data,
.check_eattr_indir = check_eattr_indir,
@@ -73,6 +74,11 @@ struct metawalk_fxns find_dirents = {
.check_eattr_extentry = NULL,
};

+static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+{
+ return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID);
+}
+
static int check_metalist(struct gfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, int h, void *private)
{
@@ -250,6 +256,11 @@ static int clear_dup_data(struct gfs2_inode *ip, uint64_t block, void *private)
return clear_dup_metalist(ip, block, NULL, 0, private);
}

+static int clear_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+{
+ return clear_dup_metalist(ip, block, NULL, 0, private);
+}
+
static int clear_dup_eattr_indir(struct gfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
@@ -392,7 +403,7 @@ static int clear_a_reference(struct gfs2_sbd *sdp, struct duptree *b,
osi_list_t *tmp, *x;
struct metawalk_fxns clear_dup_fxns = {
.private = NULL,
- .check_leaf = NULL,
+ .check_leaf = clear_leaf,
.check_metalist = clear_dup_metalist,
.check_data = clear_dup_data,
.check_eattr_indir = clear_dup_eattr_indir,
--
1.7.7.5
 

Thread Tools




All times are GMT. The time now is 01:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org