diff options
Diffstat (limited to 'fs/bfs')
-rw-r--r-- | fs/bfs/dir.c | 4 | ||||
-rw-r--r-- | fs/bfs/file.c | 1 | ||||
-rw-r--r-- | fs/bfs/inode.c | 22 |
3 files changed, 14 insertions, 13 deletions
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index d967e052b779..b14cebfd9047 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -97,7 +97,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
97 | if (!inode) | 97 | if (!inode) |
98 | return -ENOSPC; | 98 | return -ENOSPC; |
99 | mutex_lock(&info->bfs_lock); | 99 | mutex_lock(&info->bfs_lock); |
100 | ino = find_first_zero_bit(info->si_imap, info->si_lasti); | 100 | ino = find_first_zero_bit(info->si_imap, info->si_lasti + 1); |
101 | if (ino > info->si_lasti) { | 101 | if (ino > info->si_lasti) { |
102 | mutex_unlock(&info->bfs_lock); | 102 | mutex_unlock(&info->bfs_lock); |
103 | iput(inode); | 103 | iput(inode); |
@@ -176,7 +176,7 @@ static int bfs_link(struct dentry *old, struct inode *dir, | |||
176 | inc_nlink(inode); | 176 | inc_nlink(inode); |
177 | inode->i_ctime = CURRENT_TIME_SEC; | 177 | inode->i_ctime = CURRENT_TIME_SEC; |
178 | mark_inode_dirty(inode); | 178 | mark_inode_dirty(inode); |
179 | atomic_inc(&inode->i_count); | 179 | ihold(inode); |
180 | d_instantiate(new, inode); | 180 | d_instantiate(new, inode); |
181 | mutex_unlock(&info->bfs_lock); | 181 | mutex_unlock(&info->bfs_lock); |
182 | return 0; | 182 | return 0; |
diff --git a/fs/bfs/file.c b/fs/bfs/file.c index eb67edd0f8ea..f20e8a71062f 100644 --- a/fs/bfs/file.c +++ b/fs/bfs/file.c | |||
@@ -186,7 +186,6 @@ static sector_t bfs_bmap(struct address_space *mapping, sector_t block) | |||
186 | const struct address_space_operations bfs_aops = { | 186 | const struct address_space_operations bfs_aops = { |
187 | .readpage = bfs_readpage, | 187 | .readpage = bfs_readpage, |
188 | .writepage = bfs_writepage, | 188 | .writepage = bfs_writepage, |
189 | .sync_page = block_sync_page, | ||
190 | .write_begin = bfs_write_begin, | 189 | .write_begin = bfs_write_begin, |
191 | .write_end = generic_write_end, | 190 | .write_end = generic_write_end, |
192 | .bmap = bfs_bmap, | 191 | .bmap = bfs_bmap, |
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index c4daf0f5fc02..a8e37f81d097 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
15 | #include <linux/smp_lock.h> | ||
16 | #include <linux/buffer_head.h> | 15 | #include <linux/buffer_head.h> |
17 | #include <linux/vfs.h> | 16 | #include <linux/vfs.h> |
18 | #include <linux/writeback.h> | 17 | #include <linux/writeback.h> |
@@ -215,14 +214,10 @@ static void bfs_put_super(struct super_block *s) | |||
215 | if (!info) | 214 | if (!info) |
216 | return; | 215 | return; |
217 | 216 | ||
218 | lock_kernel(); | ||
219 | |||
220 | mutex_destroy(&info->bfs_lock); | 217 | mutex_destroy(&info->bfs_lock); |
221 | kfree(info->si_imap); | 218 | kfree(info->si_imap); |
222 | kfree(info); | 219 | kfree(info); |
223 | s->s_fs_info = NULL; | 220 | s->s_fs_info = NULL; |
224 | |||
225 | unlock_kernel(); | ||
226 | } | 221 | } |
227 | 222 | ||
228 | static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf) | 223 | static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
@@ -253,11 +248,18 @@ static struct inode *bfs_alloc_inode(struct super_block *sb) | |||
253 | return &bi->vfs_inode; | 248 | return &bi->vfs_inode; |
254 | } | 249 | } |
255 | 250 | ||
256 | static void bfs_destroy_inode(struct inode *inode) | 251 | static void bfs_i_callback(struct rcu_head *head) |
257 | { | 252 | { |
253 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
254 | INIT_LIST_HEAD(&inode->i_dentry); | ||
258 | kmem_cache_free(bfs_inode_cachep, BFS_I(inode)); | 255 | kmem_cache_free(bfs_inode_cachep, BFS_I(inode)); |
259 | } | 256 | } |
260 | 257 | ||
258 | static void bfs_destroy_inode(struct inode *inode) | ||
259 | { | ||
260 | call_rcu(&inode->i_rcu, bfs_i_callback); | ||
261 | } | ||
262 | |||
261 | static void init_once(void *foo) | 263 | static void init_once(void *foo) |
262 | { | 264 | { |
263 | struct bfs_inode_info *bi = foo; | 265 | struct bfs_inode_info *bi = foo; |
@@ -455,16 +457,16 @@ out: | |||
455 | return ret; | 457 | return ret; |
456 | } | 458 | } |
457 | 459 | ||
458 | static int bfs_get_sb(struct file_system_type *fs_type, | 460 | static struct dentry *bfs_mount(struct file_system_type *fs_type, |
459 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) | 461 | int flags, const char *dev_name, void *data) |
460 | { | 462 | { |
461 | return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super, mnt); | 463 | return mount_bdev(fs_type, flags, dev_name, data, bfs_fill_super); |
462 | } | 464 | } |
463 | 465 | ||
464 | static struct file_system_type bfs_fs_type = { | 466 | static struct file_system_type bfs_fs_type = { |
465 | .owner = THIS_MODULE, | 467 | .owner = THIS_MODULE, |
466 | .name = "bfs", | 468 | .name = "bfs", |
467 | .get_sb = bfs_get_sb, | 469 | .mount = bfs_mount, |
468 | .kill_sb = kill_block_super, | 470 | .kill_sb = kill_block_super, |
469 | .fs_flags = FS_REQUIRES_DEV, | 471 | .fs_flags = FS_REQUIRES_DEV, |
470 | }; | 472 | }; |