diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2012-07-18 12:38:15 -0300 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2012-07-21 01:21:46 -0300 |
commit | caeea9439653d5f859abbb14672d7321ac0ef5d0 (patch) | |
tree | fd4c82ba60ec502e45aff487bd04f1fcc9358555 | |
parent | 32fe3eea29aacefec65e070de5c79809a7b53d2e (diff) | |
download | syslinux-caeea9439653d5f859abbb14672d7321ac0ef5d0.tar.gz syslinux-caeea9439653d5f859abbb14672d7321ac0ef5d0.tar.xz syslinux-caeea9439653d5f859abbb14672d7321ac0ef5d0.zip |
xfs: Cleanup
The commit "xfs: rework the logic of xfs_get_ino_core()" has added some
trailing whitespaces, acrossed 80 columns in a few lines and used a
signed intenger to determine the block's offset of the inode, which is
actually a 64-bit unsigned integer.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | core/fs/xfs/xfs.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/core/fs/xfs/xfs.c b/core/fs/xfs/xfs.c index 89e23085..b1fa5cdf 100644 --- a/core/fs/xfs/xfs.c +++ b/core/fs/xfs/xfs.c @@ -45,37 +45,38 @@ static inline struct inode *xfs_new_inode(struct fs_info *fs) return inode; } -static inline void fill_xfs_inode_pvt(struct inode *inode, struct fs_info *fs, xfs_ino_t ino) +static inline void fill_xfs_inode_pvt(struct inode *inode, struct fs_info *fs, + xfs_ino_t ino) { - XFS_PVT(inode)->i_agblock = agnumber_to_bytes(fs, XFS_INO_TO_AGNO(fs, ino)) >> BLOCK_SHIFT(fs); + XFS_PVT(inode)->i_agblock = + agnumber_to_bytes(fs, XFS_INO_TO_AGNO(fs, ino)) >> BLOCK_SHIFT(fs); XFS_PVT(inode)->i_ino_blk = ino_to_bytes(fs, ino) >> BLOCK_SHIFT(fs); - XFS_PVT(inode)->i_block_offset = XFS_INO_TO_OFFSET((struct xfs_fs_info *)(fs->fs_info), ino) << - ((struct xfs_fs_info *)(fs->fs_info))->inode_shift; + XFS_PVT(inode)->i_block_offset = + XFS_INO_TO_OFFSET((struct xfs_fs_info *)(fs->fs_info), ino) << + ((struct xfs_fs_info *)(fs->fs_info))->inode_shift; } static xfs_dinode_t *xfs_get_ino_core(struct fs_info *fs, xfs_ino_t ino) { block_t blk; xfs_dinode_t *core; - uint8_t *p = NULL; - int offset; + uint64_t offset; xfs_debug("ino %lu", ino); blk = ino_to_bytes(fs, ino) >> BLOCK_SHIFT(fs); - offset = XFS_INO_TO_OFFSET((struct xfs_fs_info *)(fs->fs_info), ino) << + offset = XFS_INO_TO_OFFSET((struct xfs_fs_info *)(fs->fs_info), ino) << ((struct xfs_fs_info *)(fs->fs_info))->inode_shift; if (offset > BLOCK_SIZE(fs)) { xfs_error("Invalid inode offset in block!"); - xfs_debug("offset: 0x%lx", offset); + xfs_debug("offset: 0x%llx", offset); goto out; } xfs_debug("blk %llu block offset 0x%llx", blk, blk << BLOCK_SHIFT(fs)); - xfs_debug("inode offset in block in bytes is 0x%lx", offset) + xfs_debug("inode offset in block (in bytes) is 0x%llx", offset); - p = (uint8_t *)get_cache(fs->fs_dev, blk); - core = (xfs_dinode_t *)(p + offset); + core = (xfs_dinode_t *)((uint8_t *)get_cache(fs->fs_dev, blk) + offset); if (be16_to_cpu(core->di_magic) != be16_to_cpu(*(uint16_t *)XFS_DINODE_MAGIC)) { xfs_error("Inode core's magic number does not match!"); @@ -295,7 +296,7 @@ static struct inode *xfs_iget_root(struct fs_info *fs) xfs_debug("Looking for the root inode..."); core = xfs_get_ino_core(fs, XFS_INFO(fs)->rootino); - fill_xfs_inode_pvt(inode, fs, XFS_INFO(fs)->rootino); + fill_xfs_inode_pvt(inode, fs, XFS_INFO(fs)->rootino); if (!core) { xfs_error("Inode core's magic number does not match!"); xfs_debug("magic number 0x%04x", be16_to_cpu(core->di_magic)); |