diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
tree | 50c101806f4d3b6585222dda060559eb4f3e005a /fs/hfsplus/inode.c | |
parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r-- | fs/hfsplus/inode.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index fc98583cf045..12ed2b7d046b 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -18,13 +18,11 @@ | |||
18 | 18 | ||
19 | static int hfsplus_readpage(struct file *file, struct page *page) | 19 | static int hfsplus_readpage(struct file *file, struct page *page) |
20 | { | 20 | { |
21 | //printk("readpage: %lu\n", page->index); | ||
22 | return block_read_full_page(page, hfsplus_get_block); | 21 | return block_read_full_page(page, hfsplus_get_block); |
23 | } | 22 | } |
24 | 23 | ||
25 | static int hfsplus_writepage(struct page *page, struct writeback_control *wbc) | 24 | static int hfsplus_writepage(struct page *page, struct writeback_control *wbc) |
26 | { | 25 | { |
27 | //printk("writepage: %lu\n", page->index); | ||
28 | return block_write_full_page(page, hfsplus_get_block, wbc); | 26 | return block_write_full_page(page, hfsplus_get_block, wbc); |
29 | } | 27 | } |
30 | 28 | ||
@@ -92,7 +90,6 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask) | |||
92 | } while (--i && nidx < tree->node_count); | 90 | } while (--i && nidx < tree->node_count); |
93 | spin_unlock(&tree->hash_lock); | 91 | spin_unlock(&tree->hash_lock); |
94 | } | 92 | } |
95 | //printk("releasepage: %lu,%x = %d\n", page->index, mask, res); | ||
96 | return res ? try_to_free_buffers(page) : 0; | 93 | return res ? try_to_free_buffers(page) : 0; |
97 | } | 94 | } |
98 | 95 | ||
@@ -182,11 +179,6 @@ static struct dentry *hfsplus_file_lookup(struct inode *dir, struct dentry *dent | |||
182 | igrab(dir); | 179 | igrab(dir); |
183 | hlist_add_head(&inode->i_hash, &HFSPLUS_SB(sb).rsrc_inodes); | 180 | hlist_add_head(&inode->i_hash, &HFSPLUS_SB(sb).rsrc_inodes); |
184 | mark_inode_dirty(inode); | 181 | mark_inode_dirty(inode); |
185 | { | ||
186 | void hfsplus_inode_check(struct super_block *sb); | ||
187 | atomic_inc(&HFSPLUS_SB(sb).inode_cnt); | ||
188 | hfsplus_inode_check(sb); | ||
189 | } | ||
190 | out: | 182 | out: |
191 | d_add(dentry, inode); | 183 | d_add(dentry, inode); |
192 | return NULL; | 184 | return NULL; |
@@ -276,13 +268,13 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) | |||
276 | if (atomic_read(&file->f_count) != 0) | 268 | if (atomic_read(&file->f_count) != 0) |
277 | return 0; | 269 | return 0; |
278 | if (atomic_dec_and_test(&HFSPLUS_I(inode).opencnt)) { | 270 | if (atomic_dec_and_test(&HFSPLUS_I(inode).opencnt)) { |
279 | down(&inode->i_sem); | 271 | mutex_lock(&inode->i_mutex); |
280 | hfsplus_file_truncate(inode); | 272 | hfsplus_file_truncate(inode); |
281 | if (inode->i_flags & S_DEAD) { | 273 | if (inode->i_flags & S_DEAD) { |
282 | hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL); | 274 | hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL); |
283 | hfsplus_delete_inode(inode); | 275 | hfsplus_delete_inode(inode); |
284 | } | 276 | } |
285 | up(&inode->i_sem); | 277 | mutex_unlock(&inode->i_mutex); |
286 | } | 278 | } |
287 | return 0; | 279 | return 0; |
288 | } | 280 | } |
@@ -317,11 +309,6 @@ struct inode *hfsplus_new_inode(struct super_block *sb, int mode) | |||
317 | if (!inode) | 309 | if (!inode) |
318 | return NULL; | 310 | return NULL; |
319 | 311 | ||
320 | { | ||
321 | void hfsplus_inode_check(struct super_block *sb); | ||
322 | atomic_inc(&HFSPLUS_SB(sb).inode_cnt); | ||
323 | hfsplus_inode_check(sb); | ||
324 | } | ||
325 | inode->i_ino = HFSPLUS_SB(sb).next_cnid++; | 312 | inode->i_ino = HFSPLUS_SB(sb).next_cnid++; |
326 | inode->i_mode = mode; | 313 | inode->i_mode = mode; |
327 | inode->i_uid = current->fsuid; | 314 | inode->i_uid = current->fsuid; |
@@ -444,7 +431,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
444 | inode->i_size = 2 + be32_to_cpu(folder->valence); | 431 | inode->i_size = 2 + be32_to_cpu(folder->valence); |
445 | inode->i_atime = hfsp_mt2ut(folder->access_date); | 432 | inode->i_atime = hfsp_mt2ut(folder->access_date); |
446 | inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); | 433 | inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); |
447 | inode->i_ctime = inode->i_mtime; | 434 | inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date); |
435 | HFSPLUS_I(inode).create_date = folder->create_date; | ||
448 | HFSPLUS_I(inode).fs_blocks = 0; | 436 | HFSPLUS_I(inode).fs_blocks = 0; |
449 | inode->i_op = &hfsplus_dir_inode_operations; | 437 | inode->i_op = &hfsplus_dir_inode_operations; |
450 | inode->i_fop = &hfsplus_dir_operations; | 438 | inode->i_fop = &hfsplus_dir_operations; |
@@ -475,9 +463,10 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
475 | } | 463 | } |
476 | inode->i_atime = hfsp_mt2ut(file->access_date); | 464 | inode->i_atime = hfsp_mt2ut(file->access_date); |
477 | inode->i_mtime = hfsp_mt2ut(file->content_mod_date); | 465 | inode->i_mtime = hfsp_mt2ut(file->content_mod_date); |
478 | inode->i_ctime = inode->i_mtime; | 466 | inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); |
467 | HFSPLUS_I(inode).create_date = file->create_date; | ||
479 | } else { | 468 | } else { |
480 | printk("HFS+-fs: bad catalog entry used to create inode\n"); | 469 | printk(KERN_ERR "hfs: bad catalog entry used to create inode\n"); |
481 | res = -EIO; | 470 | res = -EIO; |
482 | } | 471 | } |
483 | return res; | 472 | return res; |