]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2003-12-30 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Tue, 30 Dec 2003 12:36:13 +0000 (12:36 +0000)
committerokuji <okuji@localhost>
Tue, 30 Dec 2003 12:36:13 +0000 (12:36 +0000)
* stage2/fsys_ext2fs.c (ext2_is_fast_symlink): New function.
(ext2fs_dir): Use ext2_is_fast_symlink to check if the current
inode is a fast or slow symlink. This change was required
because Linux now uses acl seriously (i.e. incompatibility).
Reported by Chris PeBenito <pebenito@gentoo.org> and Seemant
Kulleen <seemant@gentoo.org>

ChangeLog
stage2/fsys_ext2fs.c

index 988db64be3b429b224957b3c2dfbcf4592681e1e..76fbf4ae8b5a9b1adcd3f10b0f9ffc7c8246bb61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-12-30  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * stage2/fsys_ext2fs.c (ext2_is_fast_symlink): New function.
+       (ext2fs_dir): Use ext2_is_fast_symlink to check if the current
+       inode is a fast or slow symlink. This change was required
+       because Linux now uses acl seriously (i.e. incompatibility).
+       Reported by Chris PeBenito <pebenito@gentoo.org> and Seemant
+       Kulleen <seemant@gentoo.org>
+
 2003-11-30  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * lib/device.c (read_device_map) (sho_warning): New internal
index 1f272591d7cfd5429bf96adbd5868f3f313df5eb..ef37700961c871bed2dea63604522060162eeeb4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999, 2001  Free Software Foundation, Inc.
+ *  Copyright (C) 1999, 2001, 2003  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -475,6 +475,14 @@ ext2fs_read (char *buf, int len)
 
 */
 
+static inline
+int ext2_is_fast_symlink (void)
+{
+  int ea_blocks;
+  ea_blocks = INODE->i_file_acl ? EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE : 0;
+  return INODE->i_blocks == ea_blocks;
+}
+
 /* preconditions: ext2fs_mount already executed, therefore supblk in buffer
  *   known as SUPERBLOCK
  * returns: 0 if error, nonzero iff we were able to find the file successfully
@@ -618,7 +626,7 @@ ext2fs_dir (char *dirname)
          linkbuf[filemax + len] = '\0';
 
          /* Read the symlink data. */
-         if (INODE->i_blocks)
+         if (! ext2_is_fast_symlink ())
            {
              /* Read the necessary blocks, and reset the file pointer. */
              len = grub_read (linkbuf, filemax);