]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-06-29 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sun, 29 Jun 2008 21:33:38 +0000 (21:33 +0000)
committerrobertmh <robertmh@localhost>
Sun, 29 Jun 2008 21:33:38 +0000 (21:33 +0000)
        * fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro.  Maps filesystem
        block to disk block.
        (grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result.
        Patch from Niels B\303\266hm <bitbucket@arcor.de>

ChangeLog
fs/xfs.c

index e865912f25c0e3f718481a2c1c501581c7076333..7319a5e310dee893360d450b2f0db0e8fb029d66 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-29  Robert Millan  <rmh@aybabtu.com>
+
+       * fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro.  Maps filesystem
+       block to disk block.
+       (grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result.
+       Patch from Niels Böhm <bitbucket@arcor.de>
+
 2008-06-29  Robert Millan  <rmh@aybabtu.com>
 
        * util/update-grub_lib.in (font_path): Search for fonts in
index 5437678ad3a1acd065d299e785b2706a2550a89c..54d8031e07cb6000ea2659d3a65cdcf109fe4561 100644 (file)
--- a/fs/xfs.c
+++ b/fs/xfs.c
@@ -163,6 +163,10 @@ static grub_dl_t my_mod;
 #define GRUB_XFS_INO_AG(data,ino)              \
   (grub_be_to_cpu64 (ino) >> GRUB_XFS_INO_AGBITS (data))
 
+#define GRUB_XFS_FSB_TO_BLOCK(data, fsb) \
+  (((fsb) >> (data)->sblock.log2_agblk) * (data)->agsize \
+ + ((fsb) & ((1 << (data)->sblock.log2_agblk) - 1)))
+
 #define GRUB_XFS_EXTENT_OFFSET(exts,ex) \
        ((grub_be_to_cpu32 (exts[ex][0]) & ~(1 << 31)) << 23 \
        | grub_be_to_cpu32 (exts[ex][1]) >> 9)
@@ -310,7 +314,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
   if (leaf)
     grub_free (leaf);
 
-  return ret;
+  return GRUB_XFS_FSB_TO_BLOCK(node->data, ret);
 }