diff options
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r-- | fs/hfsplus/inode.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 67e1c8b467c4..b085d64a2b67 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -163,7 +163,7 @@ static struct dentry *hfsplus_file_lookup(struct inode *dir, struct dentry *dent | |||
163 | 163 | ||
164 | inode->i_ino = dir->i_ino; | 164 | inode->i_ino = dir->i_ino; |
165 | INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list); | 165 | INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list); |
166 | init_MUTEX(&HFSPLUS_I(inode).extents_lock); | 166 | mutex_init(&HFSPLUS_I(inode).extents_lock); |
167 | HFSPLUS_I(inode).flags = HFSPLUS_FLG_RSRC; | 167 | HFSPLUS_I(inode).flags = HFSPLUS_FLG_RSRC; |
168 | 168 | ||
169 | hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd); | 169 | hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd); |
@@ -238,7 +238,7 @@ static void hfsplus_set_perms(struct inode *inode, struct hfsplus_perm *perms) | |||
238 | perms->dev = cpu_to_be32(HFSPLUS_I(inode).dev); | 238 | perms->dev = cpu_to_be32(HFSPLUS_I(inode).dev); |
239 | } | 239 | } |
240 | 240 | ||
241 | static int hfsplus_permission(struct inode *inode, int mask, struct nameidata *nd) | 241 | static int hfsplus_permission(struct inode *inode, int mask) |
242 | { | 242 | { |
243 | /* MAY_EXEC is also used for lookup, if no x bit is set allow lookup, | 243 | /* MAY_EXEC is also used for lookup, if no x bit is set allow lookup, |
244 | * open_exec has the same test, so it's still not executable, if a x bit | 244 | * open_exec has the same test, so it's still not executable, if a x bit |
@@ -254,8 +254,6 @@ static int hfsplus_file_open(struct inode *inode, struct file *file) | |||
254 | { | 254 | { |
255 | if (HFSPLUS_IS_RSRC(inode)) | 255 | if (HFSPLUS_IS_RSRC(inode)) |
256 | inode = HFSPLUS_I(inode).rsrc_inode; | 256 | inode = HFSPLUS_I(inode).rsrc_inode; |
257 | if (atomic_read(&file->f_count) != 1) | ||
258 | return 0; | ||
259 | atomic_inc(&HFSPLUS_I(inode).opencnt); | 257 | atomic_inc(&HFSPLUS_I(inode).opencnt); |
260 | return 0; | 258 | return 0; |
261 | } | 259 | } |
@@ -266,8 +264,6 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) | |||
266 | 264 | ||
267 | if (HFSPLUS_IS_RSRC(inode)) | 265 | if (HFSPLUS_IS_RSRC(inode)) |
268 | inode = HFSPLUS_I(inode).rsrc_inode; | 266 | inode = HFSPLUS_I(inode).rsrc_inode; |
269 | if (atomic_read(&file->f_count) != 0) | ||
270 | return 0; | ||
271 | if (atomic_dec_and_test(&HFSPLUS_I(inode).opencnt)) { | 267 | if (atomic_dec_and_test(&HFSPLUS_I(inode).opencnt)) { |
272 | mutex_lock(&inode->i_mutex); | 268 | mutex_lock(&inode->i_mutex); |
273 | hfsplus_file_truncate(inode); | 269 | hfsplus_file_truncate(inode); |
@@ -316,7 +312,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, int mode) | |||
316 | inode->i_nlink = 1; | 312 | inode->i_nlink = 1; |
317 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; | 313 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; |
318 | INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list); | 314 | INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list); |
319 | init_MUTEX(&HFSPLUS_I(inode).extents_lock); | 315 | mutex_init(&HFSPLUS_I(inode).extents_lock); |
320 | atomic_set(&HFSPLUS_I(inode).opencnt, 0); | 316 | atomic_set(&HFSPLUS_I(inode).opencnt, 0); |
321 | HFSPLUS_I(inode).flags = 0; | 317 | HFSPLUS_I(inode).flags = 0; |
322 | memset(HFSPLUS_I(inode).first_extents, 0, sizeof(hfsplus_extent_rec)); | 318 | memset(HFSPLUS_I(inode).first_extents, 0, sizeof(hfsplus_extent_rec)); |