From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Thu, 10 Sep 2015 12:07:12 +0100 Subject: [Cluster-devel] [PATCH 2/2] gfs2_edit: Include dirent.de_rahead in directory listings In-Reply-To: <55F05E01.3030205@redhat.com> References: <1441814130-14786-1-git-send-email-andreas.gruenbacher@gmail.com> <1441814130-14786-2-git-send-email-andreas.gruenbacher@gmail.com> <55F05E01.3030205@redhat.com> Message-ID: <55F16460.5030302@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 09/09/15 17:27, Andrew Price wrote: > On 09/09/15 16:55, Andreas Gruenbacher wrote: >> When dumping a directory, for directory each entry, also print how >> many blocks >> of metadata can be read ahead when reading in the inode the entry >> points at. >> >> Signed-off-by: Andreas Gruenbacher >> --- >> gfs2/edit/extended.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c >> index e5cb12c..7a219ee 100644 >> --- a/gfs2/edit/extended.c >> +++ b/gfs2/edit/extended.c >> @@ -342,13 +342,14 @@ static int display_leaf(struct iinfo *ind) >> strcpy(edit_fmt, "%llx"); >> } >> } >> - print_gfs2("%d/%d [%08x] %lld/%lld (0x%llx/0x%llx): ", >> + print_gfs2("%d/%d [%08x] %lld/%lld (0x%llx/0x%llx) +%d: ", >> total_dirents, d + 1, >> ind->ii[0].dirent[d].dirent.de_hash, >> ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino, >> ind->ii[0].dirent[d].block, >> ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino, >> - ind->ii[0].dirent[d].block); >> + ind->ii[0].dirent[d].block, >> + (unsigned int)ind->ii[0].dirent[d].dirent.de_rahead); > > It would be better to use %u for an unsigned int. We don't have > __attribute__((format(printf...))) on print_gfs2 yet but it would catch > that. I've pushed both patches, including the above tweak, and added another patch to support older versions which don't have the de_rahead field (< Linux 3.15). Thanks, Andy