Skip to content

Commit

Permalink
[PATCH] hfs: set type/creator for symlinks
Browse files Browse the repository at this point in the history
Set the correct type and creator for symlinks.

Signed-off-by: Roman Zippel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Roman Zippel authored and Linus Torvalds committed Jan 19, 2006
1 parent af8c85b commit 6b19283
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/hfsplus/catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions fs/hfsplus/hfsplus_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6b19283

Please sign in to comment.