diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2013-01-21 16:21:51 -0200 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2013-01-21 16:28:43 -0200 |
commit | d8389b0b1ca6086f7e33b1fc7d89fbefc19bafdc (patch) | |
tree | 3a6531271c888232ae9a53dafc01531b29646185 | |
parent | 51e6a071378786c799a23fb758534cb8ac959a25 (diff) | |
download | syslinux-d8389b0b1ca6086f7e33b1fc7d89fbefc19bafdc.tar.gz syslinux-d8389b0b1ca6086f7e33b1fc7d89fbefc19bafdc.tar.xz syslinux-d8389b0b1ca6086f7e33b1fc7d89fbefc19bafdc.zip |
xfs: Make it more verbose on debug
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | core/fs/xfs/xfs.c | 6 | ||||
-rw-r--r-- | core/fs/xfs/xfs.h | 15 | ||||
-rw-r--r-- | core/fs/xfs/xfs_dinode.c | 4 | ||||
-rw-r--r-- | core/fs/xfs/xfs_dir2.c | 9 | ||||
-rw-r--r-- | core/fs/xfs/xfs_readdir.c | 12 |
5 files changed, 35 insertions, 11 deletions
diff --git a/core/fs/xfs/xfs.c b/core/fs/xfs/xfs.c index a1826aea..60a67f5d 100644 --- a/core/fs/xfs/xfs.c +++ b/core/fs/xfs/xfs.c @@ -67,6 +67,8 @@ static int xfs_readdir(struct file *file, struct dirent *dirent) xfs_dinode_t *core; struct inode *inode = file->inode; + xfs_debug("file %p dirent %p"); + core = xfs_dinode_get_core(fs, inode->ino); if (!core) { xfs_error("Failed to get dinode from disk (ino %llx)", inode->ino); @@ -103,6 +105,8 @@ static int xfs_next_extent(struct inode *inode, uint32_t lstart) (void)lstart; + xfs_debug("inode %p lstart %lu", inode, lstart); + core = xfs_dinode_get_core(fs, inode->ino); if (!core) { xfs_error("Failed to get dinode from disk (ino %llx)", inode->ino); @@ -263,6 +267,8 @@ static int xfs_readlink(struct inode *inode, char *buf) block_t db; char *dir_buf; + xfs_debug("inode %p buf %p", inode, buf); + core = xfs_dinode_get_core(fs, inode->ino); if (!core) { xfs_error("Failed to get dinode from disk (ino 0x%llx)", inode->ino); diff --git a/core/fs/xfs/xfs.h b/core/fs/xfs/xfs.h index 49c93024..11e8634a 100644 --- a/core/fs/xfs/xfs.h +++ b/core/fs/xfs/xfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Paulo Alcantara <pcacjr@zytor.com> + * Copyright (c) 2012-2013 Paulo Alcantara <pcacjr@zytor.com> * * Some parts borrowed from Linux kernel tree (linux/fs/xfs): * @@ -30,14 +30,15 @@ #include "xfs_types.h" #include "xfs_ag.h" -#define xfs_error(fmt, args...) \ - ({ \ - printf("%s%s: xfs: [ERROR] " fmt "\n", __func__, __LINE__, ## args); \ +#define xfs_error(fmt, args...) \ + ({ \ + printf("%s:%u: xfs - [ERROR] " fmt "\n", __func__, __LINE__, ## args); \ }) -#define xfs_debug(fmt, args...) \ - ({ \ - dprintf("%s%s: xfs: [DEBUG] " fmt "\n", __func__, __LINE__, ## args); \ +#define xfs_debug(fmt, args...) \ + ({ \ + dprintf("%s:%u: xfs - [DEBUG] " fmt "\n", __func__, __LINE__, \ + ## args); \ }) struct xfs_fs_info; diff --git a/core/fs/xfs/xfs_dinode.c b/core/fs/xfs/xfs_dinode.c index 8e2d8d04..55be6e2d 100644 --- a/core/fs/xfs/xfs_dinode.c +++ b/core/fs/xfs/xfs_dinode.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Paulo Alcantara <pcacjr@zytor.com> + * Copyright (c) 2012-2013 Paulo Alcantara <pcacjr@zytor.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -33,7 +33,7 @@ xfs_dinode_t *xfs_dinode_get_core(struct fs_info *fs, xfs_ino_t ino) xfs_dinode_t *core; uint64_t offset; - xfs_debug("ino %lu", ino); + xfs_debug("fs %p ino %lu", fs, ino); blk = ino_to_bytes(fs, ino) >> BLOCK_SHIFT(fs); offset = XFS_INO_TO_OFFSET(XFS_INFO(fs), ino) << XFS_INFO(fs)->inode_shift; diff --git a/core/fs/xfs/xfs_dir2.c b/core/fs/xfs/xfs_dir2.c index c52196ae..97a3eb08 100644 --- a/core/fs/xfs/xfs_dir2.c +++ b/core/fs/xfs/xfs_dir2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Paulo Alcantara <pcacjr@zytor.com> + * Copyright (c) 2012-2013 Paulo Alcantara <pcacjr@zytor.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -107,6 +107,7 @@ struct inode *xfs_dir2_local_find_entry(const char *dname, struct inode *parent, xfs_intino_t ino; xfs_dinode_t *ncore = NULL; + xfs_debug("dname %s parent %p core %p", dname, parent, core); xfs_debug("count %hhu i8count %hhu", sf->hdr.count, sf->hdr.i8count); sf_entry = (xfs_dir2_sf_entry_t *)((uint8_t *)&sf->list[0] - @@ -194,6 +195,8 @@ struct inode *xfs_dir2_block_find_entry(const char *dname, struct inode *parent, xfs_intino_t ino; xfs_dinode_t *ncore; + xfs_debug("dname %s parent %p core %p", dname, parent, core); + bmbt_irec_get(&r, (xfs_bmbt_rec_t *)&core->di_literal_area[0]); dir_blk = fsblock_to_bytes(fs, r.br_startblock) >> BLOCK_SHIFT(fs); @@ -307,6 +310,8 @@ struct inode *xfs_dir2_leaf_find_entry(const char *dname, struct inode *parent, xfs_dinode_t *ncore; uint8_t *buf = NULL; + xfs_debug("dname %s parent %p core %p", dname, parent, core); + bmbt_irec_get(&irec, ((xfs_bmbt_rec_t *)&core->di_literal_area[0]) + be32_to_cpu(core->di_nextents) - 1); leaf_blk = fsblock_to_bytes(parent->fs, irec.br_startblock) >> @@ -569,6 +574,8 @@ struct inode *xfs_dir2_node_find_entry(const char *dname, struct inode *parent, xfs_dinode_t *ncore; uint8_t *buf = NULL; + xfs_debug("dname %s parent %p core %p", dname, parent, core); + hashwant = xfs_dir2_da_hashname((uint8_t *)dname, strlen(dname)); fsblkno = xfs_dir2_get_right_blk(parent->fs, core, diff --git a/core/fs/xfs/xfs_readdir.c b/core/fs/xfs/xfs_readdir.c index 0e013e55..e3e62858 100644 --- a/core/fs/xfs/xfs_readdir.c +++ b/core/fs/xfs/xfs_readdir.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Paulo Alcantara <pcacjr@zytor.com> + * Copyright (c) 2012-2013 Paulo Alcantara <pcacjr@zytor.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -35,6 +35,9 @@ static int fill_dirent(struct fs_info *fs, struct dirent *dirent, { xfs_dinode_t *core; + xfs_debug("fs %p, dirent %p offset %lu ino %llu name %s namelen %llu", fs, + dirent, offset, ino, name, namelen); + dirent->d_ino = ino; dirent->d_off = offset; dirent->d_reclen = offsetof(struct dirent, d_name) + namelen + 1; @@ -71,6 +74,7 @@ int xfs_readdir_dir2_local(struct file *file, struct dirent *dirent, struct fs_info *fs = file->fs; int retval = 0; + xfs_debug("file %p dirent %p core %p", file, dirent, core); xfs_debug("count %hhu i8count %hhu", sf->hdr.count, sf->hdr.i8count); if (file->offset + 1 > count) @@ -133,6 +137,8 @@ int xfs_readdir_dir2_block(struct file *file, struct dirent *dirent, xfs_ino_t ino; int retval = 0; + xfs_debug("file %p dirent %p core %p", file, dirent, core); + bmbt_irec_get(&r, (xfs_bmbt_rec_t *)&core->di_literal_area[0]); dir_blk = fsblock_to_bytes(fs, r.br_startblock) >> BLOCK_SHIFT(fs); @@ -209,6 +215,8 @@ int xfs_readdir_dir2_leaf(struct file *file, struct dirent *dirent, uint8_t *buf = NULL; int retval = 0; + xfs_debug("file %p dirent %p core %p", file, dirent, core); + bmbt_irec_get(&irec, ((xfs_bmbt_rec_t *)&core->di_literal_area[0]) + be32_to_cpu(core->di_nextents) - 1); leaf_blk = fsblock_to_bytes(fs, irec.br_startblock) >> @@ -298,6 +306,8 @@ int xfs_readdir_dir2_node(struct file *file, struct dirent *dirent, uint8_t *buf = NULL; int retval = 0; + xfs_debug("file %p dirent %p core %p", file, dirent, core); + do { bmbt_irec_get(&irec, (xfs_bmbt_rec_t *)&core->di_literal_area[0] + ++node_off); |