diff options
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/hpfs_fn.h | 1 | ||||
-rw-r--r-- | fs/hpfs/namei.c | 2 | ||||
-rw-r--r-- | fs/hpfs/super.c | 28 |
3 files changed, 16 insertions, 15 deletions
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index 1b398636e990..6797bf80f6e2 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h | |||
@@ -80,6 +80,7 @@ struct hpfs_sb_info { | |||
80 | unsigned sb_c_bitmap; /* current bitmap */ | 80 | unsigned sb_c_bitmap; /* current bitmap */ |
81 | unsigned sb_max_fwd_alloc; /* max forwad allocation */ | 81 | unsigned sb_max_fwd_alloc; /* max forwad allocation */ |
82 | int sb_timeshift; | 82 | int sb_timeshift; |
83 | struct rcu_head rcu; | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | /* Four 512-byte buffers and the 2k block obtained by concatenating them */ | 86 | /* Four 512-byte buffers and the 2k block obtained by concatenating them */ |
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 345713d2f8f3..1b39afdd86fd 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
@@ -407,7 +407,7 @@ again: | |||
407 | /*printk("HPFS: truncating file before delete.\n");*/ | 407 | /*printk("HPFS: truncating file before delete.\n");*/ |
408 | newattrs.ia_size = 0; | 408 | newattrs.ia_size = 0; |
409 | newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; | 409 | newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; |
410 | err = notify_change(dentry, &newattrs); | 410 | err = notify_change(dentry, &newattrs, NULL); |
411 | put_write_access(inode); | 411 | put_write_access(inode); |
412 | if (!err) | 412 | if (!err) |
413 | goto again; | 413 | goto again; |
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 4334cda8dba1..b8d01ef6f531 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c | |||
@@ -101,18 +101,24 @@ int hpfs_stop_cycles(struct super_block *s, int key, int *c1, int *c2, | |||
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static void hpfs_put_super(struct super_block *s) | 104 | static void free_sbi(struct hpfs_sb_info *sbi) |
105 | { | 105 | { |
106 | struct hpfs_sb_info *sbi = hpfs_sb(s); | 106 | kfree(sbi->sb_cp_table); |
107 | kfree(sbi->sb_bmp_dir); | ||
108 | kfree(sbi); | ||
109 | } | ||
107 | 110 | ||
111 | static void lazy_free_sbi(struct rcu_head *rcu) | ||
112 | { | ||
113 | free_sbi(container_of(rcu, struct hpfs_sb_info, rcu)); | ||
114 | } | ||
115 | |||
116 | static void hpfs_put_super(struct super_block *s) | ||
117 | { | ||
108 | hpfs_lock(s); | 118 | hpfs_lock(s); |
109 | unmark_dirty(s); | 119 | unmark_dirty(s); |
110 | hpfs_unlock(s); | 120 | hpfs_unlock(s); |
111 | 121 | call_rcu(&hpfs_sb(s)->rcu, lazy_free_sbi); | |
112 | kfree(sbi->sb_cp_table); | ||
113 | kfree(sbi->sb_bmp_dir); | ||
114 | s->s_fs_info = NULL; | ||
115 | kfree(sbi); | ||
116 | } | 122 | } |
117 | 123 | ||
118 | unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno) | 124 | unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno) |
@@ -485,9 +491,6 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | |||
485 | } | 491 | } |
486 | s->s_fs_info = sbi; | 492 | s->s_fs_info = sbi; |
487 | 493 | ||
488 | sbi->sb_bmp_dir = NULL; | ||
489 | sbi->sb_cp_table = NULL; | ||
490 | |||
491 | mutex_init(&sbi->hpfs_mutex); | 494 | mutex_init(&sbi->hpfs_mutex); |
492 | hpfs_lock(s); | 495 | hpfs_lock(s); |
493 | 496 | ||
@@ -679,10 +682,7 @@ bail2: brelse(bh0); | |||
679 | bail1: | 682 | bail1: |
680 | bail0: | 683 | bail0: |
681 | hpfs_unlock(s); | 684 | hpfs_unlock(s); |
682 | kfree(sbi->sb_bmp_dir); | 685 | free_sbi(sbi); |
683 | kfree(sbi->sb_cp_table); | ||
684 | s->s_fs_info = NULL; | ||
685 | kfree(sbi); | ||
686 | return -EINVAL; | 686 | return -EINVAL; |
687 | } | 687 | } |
688 | 688 | ||