From 7b5bbba801231e63c844edc5a53303bf2889dabd Mon Sep 17 00:00:00 2001 From: Coly Li Date: Fri, 5 Mar 2010 16:15:20 +0800 Subject: [PATCH 09/15] dx_dirs: add 'blocknr' in callback of ocfs2_dir_iterate() In order to make ocfs2_dx_dir_insert() easier to set the dir block number to a dx record, a new parameter 'uint64_t blocknr' is added into the call back function parameter of ocfs2_dir_iterate(). This patch includes (part of) the related changes which are not mentioned in previous patches. Signed-off-by: Coly Li Cc: Mark Fasheh --- debugfs.ocfs2/dump.c | 6 +++--- debugfs.ocfs2/find_inode_paths.c | 3 ++- debugfs.ocfs2/include/dump.h | 2 +- debugfs.ocfs2/utils.c | 4 ++-- extras/find_hardlinks.c | 1 + extras/find_inode_paths.c | 1 + fswreck/dir.c | 3 +++ ocfs2console/ocfs2interface/ocfs2module.c | 1 + tunefs.ocfs2/feature_quota.c | 3 ++- tunefs.ocfs2/op_list_sparse_files.c | 4 ++-- tunefs.ocfs2/op_set_slot_count.c | 10 ++++++---- 11 files changed, 24 insertions(+), 14 deletions(-) diff --git a/debugfs.ocfs2/dump.c b/debugfs.ocfs2/dump.c index 88ec430..d55fc0e 100644 --- a/debugfs.ocfs2/dump.c +++ b/debugfs.ocfs2/dump.c @@ -461,8 +461,8 @@ void dump_group_descriptor (FILE *out, struct ocfs2_group_desc *grp, * dump_dir_entry() * */ -int dump_dir_entry (struct ocfs2_dir_entry *rec, int offset, int blocksize, - char *buf, void *priv_data) +int dump_dir_entry (struct ocfs2_dir_entry *rec, uint64_t blocknr, int offset, + int blocksize, char *buf, void *priv_data) { list_dir_opts *ls = (list_dir_opts *)priv_data; char tmp = rec->name[rec->name_len]; @@ -544,7 +544,7 @@ void dump_dir_block(FILE *out, char *buf) return; } - dump_dir_entry(dirent, offset, gbls.fs->fs_blocksize, NULL, + dump_dir_entry(dirent, 0, offset, gbls.fs->fs_blocksize, NULL, &ls_opts); offset += dirent->rec_len; } diff --git a/debugfs.ocfs2/find_inode_paths.c b/debugfs.ocfs2/find_inode_paths.c index e2d0e7d..cf9e88a 100644 --- a/debugfs.ocfs2/find_inode_paths.c +++ b/debugfs.ocfs2/find_inode_paths.c @@ -38,7 +38,8 @@ struct walk_path { uint64_t *inode; }; -static int walk_tree_func(struct ocfs2_dir_entry *dentry, int offset, +static int walk_tree_func(struct ocfs2_dir_entry *dentry, + uint64_t blocknr, int offset, int blocksize, char *buf, void *priv_data) { errcode_t ret; diff --git a/debugfs.ocfs2/include/dump.h b/debugfs.ocfs2/include/dump.h index 79b10b3..ae7b34a 100644 --- a/debugfs.ocfs2/include/dump.h +++ b/debugfs.ocfs2/include/dump.h @@ -50,7 +50,7 @@ void dump_extent_list (FILE *out, struct ocfs2_extent_list *ext); void dump_chain_list (FILE *out, struct ocfs2_chain_list *cl); void dump_extent_block (FILE *out, struct ocfs2_extent_block *blk); void dump_group_descriptor (FILE *out, struct ocfs2_group_desc *grp, int index); -int dump_dir_entry (struct ocfs2_dir_entry *rec, int offset, int blocksize, +int dump_dir_entry (struct ocfs2_dir_entry *rec, uint64_t blocknr, int offset, int blocksize, char *buf, void *priv_data); void dump_dx_root (FILE *out, struct ocfs2_dx_root_block *dx_root); void dump_dx_leaf (FILE *out, struct ocfs2_dx_leaf *dx_leaf); diff --git a/debugfs.ocfs2/utils.c b/debugfs.ocfs2/utils.c index 6107d9e..2c5b588 100644 --- a/debugfs.ocfs2/utils.c +++ b/debugfs.ocfs2/utils.c @@ -674,8 +674,8 @@ bail: * Copyright (C) 1994 Theodore Ts'o. This file may be redistributed * under the terms of the GNU Public License. */ -static int rdump_dirent(struct ocfs2_dir_entry *rec, int offset, int blocksize, - char *buf, void *priv_data) +static int rdump_dirent(struct ocfs2_dir_entry *rec, uint64_t blocknr, + int offset, int blocksize, char *buf, void *priv_data) { rdump_opts *rd = (rdump_opts *)priv_data; char tmp = rec->name[rec->name_len]; diff --git a/extras/find_hardlinks.c b/extras/find_hardlinks.c index b70f58b..2e1f697 100644 --- a/extras/find_hardlinks.c +++ b/extras/find_hardlinks.c @@ -55,6 +55,7 @@ struct walk_path { }; static int walk_tree_func(struct ocfs2_dir_entry *dentry, + uint64_t blocknr, int offset, int blocksize, char *buf, diff --git a/extras/find_inode_paths.c b/extras/find_inode_paths.c index 1725b40..b9ad920 100644 --- a/extras/find_inode_paths.c +++ b/extras/find_inode_paths.c @@ -53,6 +53,7 @@ struct walk_path { }; static int walk_tree_func(struct ocfs2_dir_entry *dentry, + uint64_t blocknr, int offset, int blocksize, char *buf, diff --git a/fswreck/dir.c b/fswreck/dir.c index 37874ea..902a369 100644 --- a/fswreck/dir.c +++ b/fswreck/dir.c @@ -112,6 +112,7 @@ static int corrupt_match_dirent(struct dirent_corrupt_struct *dcs, } static int rename_dirent_proc(struct ocfs2_dir_entry *dirent, + uint64_t blocknr, int offset, int blocksize, char *buf, @@ -157,6 +158,7 @@ static int rename_dirent(ocfs2_filesys *fs, uint64_t dir, } static int corrupt_dirent_ino_proc(struct ocfs2_dir_entry *dirent, + uint64_t blocknr, int offset, int blocksize, char *buf, @@ -200,6 +202,7 @@ static int corrupt_dirent_ino(ocfs2_filesys *fs, uint64_t dir, } static int corrupt_dirent_reclen_proc(struct ocfs2_dir_entry *dirent, + uint64_t blocknr, int offset, int blocksize, char *buf, diff --git a/ocfs2console/ocfs2interface/ocfs2module.c b/ocfs2console/ocfs2interface/ocfs2module.c index bd3139d..18ad04c 100644 --- a/ocfs2console/ocfs2interface/ocfs2module.c +++ b/ocfs2console/ocfs2interface/ocfs2module.c @@ -735,6 +735,7 @@ typedef struct static int walk_dirs (struct ocfs2_dir_entry *dirent, + uint64_t blocknr, int offset, int blocksize, char *buf, diff --git a/tunefs.ocfs2/feature_quota.c b/tunefs.ocfs2/feature_quota.c index 2da3cbe..08d7770 100644 --- a/tunefs.ocfs2/feature_quota.c +++ b/tunefs.ocfs2/feature_quota.c @@ -165,7 +165,8 @@ struct remove_quota_files_ctxt { }; static int remove_quota_files_iterate(struct ocfs2_dir_entry *dirent, - int offset, int blocksize, char *buf, + uint64_t blocknr, int offset, + int blocksize, char *buf, void *priv_data) { struct remove_quota_files_ctxt *ctxt = priv_data; diff --git a/tunefs.ocfs2/op_list_sparse_files.c b/tunefs.ocfs2/op_list_sparse_files.c index 2f81d36..3127876 100644 --- a/tunefs.ocfs2/op_list_sparse_files.c +++ b/tunefs.ocfs2/op_list_sparse_files.c @@ -290,8 +290,8 @@ bail: } static int list_sparse_func(struct ocfs2_dir_entry *dirent, - int offset, int blocksize, - char *buf, void *priv_data) + uint64_t blocknr, int offset, + int blocksize, char *buf, void *priv_data) { errcode_t ret; char *di_buf = NULL; diff --git a/tunefs.ocfs2/op_set_slot_count.c b/tunefs.ocfs2/op_set_slot_count.c index 46ce2de..cdd4f1a 100644 --- a/tunefs.ocfs2/op_set_slot_count.c +++ b/tunefs.ocfs2/op_set_slot_count.c @@ -699,8 +699,9 @@ static errcode_t truncate_orphan_dir(ocfs2_filesys *fs, return ret; } -static int remove_slot_iterate(struct ocfs2_dir_entry *dirent, int offset, - int blocksize, char *buf, void *priv_data) +static int remove_slot_iterate(struct ocfs2_dir_entry *dirent, + uint64_t blocknr, int offset, int blocksize, + char *buf, void *priv_data) { struct remove_slot_ctxt *ctxt = (struct remove_slot_ctxt *)priv_data; @@ -783,8 +784,9 @@ bail: return ret; } -static int orphan_iterate(struct ocfs2_dir_entry *dirent, int offset, - int blocksize, char *buf, void *priv_data) +static int orphan_iterate(struct ocfs2_dir_entry *dirent, + uint64_t blocknr, int offset, int blocksize, + char *buf, void *priv_data) { int *has_orphan = (int *)priv_data; -- 1.6.4.2