diff options
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r-- | fs/hfsplus/inode.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index a05b3afa7230..746e0ee20717 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -267,7 +267,13 @@ static void hfsplus_set_perms(struct inode *inode, struct hfsplus_perm *perms) | |||
267 | perms->mode = cpu_to_be16(inode->i_mode); | 267 | perms->mode = cpu_to_be16(inode->i_mode); |
268 | perms->owner = cpu_to_be32(inode->i_uid); | 268 | perms->owner = cpu_to_be32(inode->i_uid); |
269 | perms->group = cpu_to_be32(inode->i_gid); | 269 | perms->group = cpu_to_be32(inode->i_gid); |
270 | perms->dev = cpu_to_be32(HFSPLUS_I(inode)->dev); | 270 | |
271 | if (S_ISREG(inode->i_mode)) | ||
272 | perms->dev = cpu_to_be32(inode->i_nlink); | ||
273 | else if (S_ISBLK(inode->i_mode) || S_ISCHR(inode->i_mode)) | ||
274 | perms->dev = cpu_to_be32(inode->i_rdev); | ||
275 | else | ||
276 | perms->dev = 0; | ||
271 | } | 277 | } |
272 | 278 | ||
273 | static int hfsplus_file_open(struct inode *inode, struct file *file) | 279 | static int hfsplus_file_open(struct inode *inode, struct file *file) |
@@ -491,7 +497,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
491 | 497 | ||
492 | type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset); | 498 | type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset); |
493 | 499 | ||
494 | HFSPLUS_I(inode)->dev = 0; | 500 | HFSPLUS_I(inode)->linkid = 0; |
495 | if (type == HFSPLUS_FOLDER) { | 501 | if (type == HFSPLUS_FOLDER) { |
496 | struct hfsplus_cat_folder *folder = &entry.folder; | 502 | struct hfsplus_cat_folder *folder = &entry.folder; |
497 | 503 | ||
@@ -595,10 +601,6 @@ int hfsplus_cat_write_inode(struct inode *inode) | |||
595 | hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, | 601 | hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, |
596 | sizeof(struct hfsplus_cat_file)); | 602 | sizeof(struct hfsplus_cat_file)); |
597 | hfsplus_inode_write_fork(inode, &file->data_fork); | 603 | hfsplus_inode_write_fork(inode, &file->data_fork); |
598 | if (S_ISREG(inode->i_mode)) | ||
599 | HFSPLUS_I(inode)->dev = inode->i_nlink; | ||
600 | if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) | ||
601 | HFSPLUS_I(inode)->dev = kdev_t_to_nr(inode->i_rdev); | ||
602 | hfsplus_set_perms(inode, &file->permissions); | 604 | hfsplus_set_perms(inode, &file->permissions); |
603 | if ((file->permissions.rootflags | file->permissions.userflags) & HFSPLUS_FLG_IMMUTABLE) | 605 | if ((file->permissions.rootflags | file->permissions.userflags) & HFSPLUS_FLG_IMMUTABLE) |
604 | file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED); | 606 | file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED); |