]> err.no Git - linux-2.6/commitdiff
[PATCH] hfs: set type/creator for symlinks
authorRoman Zippel <zippel@linux-m68k.org>
Thu, 19 Jan 2006 01:43:12 +0000 (17:43 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 19 Jan 2006 03:20:23 +0000 (19:20 -0800)
Set the correct type and creator for symlinks.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/hfsplus/catalog.c
fs/hfsplus/hfsplus_raw.h

index 04058c8096d145235a6c566967069fb0a9ae1f27..f2d7c49ce7595d16ed12e3ae834dbe6e93b54c6d 100644 (file)
@@ -119,8 +119,13 @@ static int hfsplus_cat_build_record(hfsplus_cat_entry *entry, u32 cnid, struct i
                        file->access_date = hfsp_now2mt();
                if (cnid == inode->i_ino) {
                        hfsplus_set_perms(inode, &file->permissions);
-                       file->user_info.fdType = cpu_to_be32(HFSPLUS_SB(inode->i_sb).type);
-                       file->user_info.fdCreator = cpu_to_be32(HFSPLUS_SB(inode->i_sb).creator);
+                       if (S_ISLNK(inode->i_mode)) {
+                               file->user_info.fdType = cpu_to_be32(HFSP_SYMLINK_TYPE);
+                               file->user_info.fdCreator = cpu_to_be32(HFSP_SYMLINK_CREATOR);
+                       } else {
+                               file->user_info.fdType = cpu_to_be32(HFSPLUS_SB(inode->i_sb).type);
+                               file->user_info.fdCreator = cpu_to_be32(HFSPLUS_SB(inode->i_sb).creator);
+                       }
                        if ((file->permissions.rootflags | file->permissions.userflags) & HFSPLUS_FLG_IMMUTABLE)
                                file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED);
                } else {
index ccc47966dc54e54d8fd0710cd121a900ff130972..49205531a5006b0ce731908628c5d485afeed77c 100644 (file)
@@ -43,6 +43,9 @@
 #define HFSP_HARDLINK_TYPE     0x686c6e6b      /* 'hlnk' */
 #define HFSP_HFSPLUS_CREATOR   0x6866732b      /* 'hfs+' */
 
+#define HFSP_SYMLINK_TYPE      0x736c6e6b      /* 'slnk' */
+#define HFSP_SYMLINK_CREATOR   0x72686170      /* 'rhap' */
+
 #define HFSP_MOUNT_VERSION     0x482b4c78      /* 'H+Lx' */
 
 /* Structures used on disk */