aboutsummaryrefslogtreecommitdiffstats
path: root/fs/freevxfs
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/freevxfs
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'fs/freevxfs')
-rw-r--r--fs/freevxfs/vxfs_fshead.c2
-rw-r--r--fs/freevxfs/vxfs_inode.c12
-rw-r--r--fs/freevxfs/vxfs_lookup.c16
-rw-r--r--fs/freevxfs/vxfs_olt.h2
-rw-r--r--fs/freevxfs/vxfs_subr.c1
-rw-r--r--fs/freevxfs/vxfs_super.c16
6 files changed, 20 insertions, 29 deletions
diff --git a/fs/freevxfs/vxfs_fshead.c b/fs/freevxfs/vxfs_fshead.c
index 78948b4b1894..c9a6a94e58e9 100644
--- a/fs/freevxfs/vxfs_fshead.c
+++ b/fs/freevxfs/vxfs_fshead.c
@@ -164,7 +164,7 @@ vxfs_read_fshead(struct super_block *sbp)
164 goto out_free_pfp; 164 goto out_free_pfp;
165 } 165 }
166 if (!VXFS_ISILT(VXFS_INO(infp->vsi_stilist))) { 166 if (!VXFS_ISILT(VXFS_INO(infp->vsi_stilist))) {
167 printk(KERN_ERR "vxfs: structual list inode is of wrong type (%x)\n", 167 printk(KERN_ERR "vxfs: structural list inode is of wrong type (%x)\n",
168 VXFS_INO(infp->vsi_stilist)->vii_mode & VXFS_TYPE_MASK); 168 VXFS_INO(infp->vsi_stilist)->vii_mode & VXFS_TYPE_MASK);
169 goto out_iput_stilist; 169 goto out_iput_stilist;
170 } 170 }
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index 79d1b4ea13e7..1a4311437a8b 100644
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -260,6 +260,7 @@ vxfs_get_fake_inode(struct super_block *sbp, struct vxfs_inode_info *vip)
260 struct inode *ip = NULL; 260 struct inode *ip = NULL;
261 261
262 if ((ip = new_inode(sbp))) { 262 if ((ip = new_inode(sbp))) {
263 ip->i_ino = get_next_ino();
263 vxfs_iinit(ip, vip); 264 vxfs_iinit(ip, vip);
264 ip->i_mapping->a_ops = &vxfs_aops; 265 ip->i_mapping->a_ops = &vxfs_aops;
265 } 266 }
@@ -271,7 +272,7 @@ vxfs_get_fake_inode(struct super_block *sbp, struct vxfs_inode_info *vip)
271 * *ip: VFS inode 272 * *ip: VFS inode
272 * 273 *
273 * Description: 274 * Description:
274 * vxfs_put_fake_inode frees all data asssociated with @ip. 275 * vxfs_put_fake_inode frees all data associated with @ip.
275 */ 276 */
276void 277void
277vxfs_put_fake_inode(struct inode *ip) 278vxfs_put_fake_inode(struct inode *ip)
@@ -336,6 +337,13 @@ vxfs_iget(struct super_block *sbp, ino_t ino)
336 return ip; 337 return ip;
337} 338}
338 339
340static void vxfs_i_callback(struct rcu_head *head)
341{
342 struct inode *inode = container_of(head, struct inode, i_rcu);
343 INIT_LIST_HEAD(&inode->i_dentry);
344 kmem_cache_free(vxfs_inode_cachep, inode->i_private);
345}
346
339/** 347/**
340 * vxfs_evict_inode - remove inode from main memory 348 * vxfs_evict_inode - remove inode from main memory
341 * @ip: inode to discard. 349 * @ip: inode to discard.
@@ -349,5 +357,5 @@ vxfs_evict_inode(struct inode *ip)
349{ 357{
350 truncate_inode_pages(&ip->i_data, 0); 358 truncate_inode_pages(&ip->i_data, 0);
351 end_writeback(ip); 359 end_writeback(ip);
352 kmem_cache_free(vxfs_inode_cachep, ip->i_private); 360 call_rcu(&ip->i_rcu, vxfs_i_callback);
353} 361}
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c
index 0ec7bb2c95c6..3360f1e678ad 100644
--- a/fs/freevxfs/vxfs_lookup.c
+++ b/fs/freevxfs/vxfs_lookup.c
@@ -36,7 +36,6 @@
36#include <linux/highmem.h> 36#include <linux/highmem.h>
37#include <linux/kernel.h> 37#include <linux/kernel.h>
38#include <linux/pagemap.h> 38#include <linux/pagemap.h>
39#include <linux/smp_lock.h>
40 39
41#include "vxfs.h" 40#include "vxfs.h"
42#include "vxfs_dir.h" 41#include "vxfs_dir.h"
@@ -163,7 +162,7 @@ vxfs_find_entry(struct inode *ip, struct dentry *dp, struct page **ppp)
163/** 162/**
164 * vxfs_inode_by_name - find inode number for dentry 163 * vxfs_inode_by_name - find inode number for dentry
165 * @dip: directory to search in 164 * @dip: directory to search in
166 * @dp: dentry we seach for 165 * @dp: dentry we search for
167 * 166 *
168 * Description: 167 * Description:
169 * vxfs_inode_by_name finds out the inode number of 168 * vxfs_inode_by_name finds out the inode number of
@@ -212,16 +211,12 @@ vxfs_lookup(struct inode *dip, struct dentry *dp, struct nameidata *nd)
212 if (dp->d_name.len > VXFS_NAMELEN) 211 if (dp->d_name.len > VXFS_NAMELEN)
213 return ERR_PTR(-ENAMETOOLONG); 212 return ERR_PTR(-ENAMETOOLONG);
214 213
215 lock_kernel();
216 ino = vxfs_inode_by_name(dip, dp); 214 ino = vxfs_inode_by_name(dip, dp);
217 if (ino) { 215 if (ino) {
218 ip = vxfs_iget(dip->i_sb, ino); 216 ip = vxfs_iget(dip->i_sb, ino);
219 if (IS_ERR(ip)) { 217 if (IS_ERR(ip))
220 unlock_kernel();
221 return ERR_CAST(ip); 218 return ERR_CAST(ip);
222 }
223 } 219 }
224 unlock_kernel();
225 d_add(dp, ip); 220 d_add(dp, ip);
226 return NULL; 221 return NULL;
227} 222}
@@ -248,8 +243,6 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler)
248 u_long page, npages, block, pblocks, nblocks, offset; 243 u_long page, npages, block, pblocks, nblocks, offset;
249 loff_t pos; 244 loff_t pos;
250 245
251 lock_kernel();
252
253 switch ((long)fp->f_pos) { 246 switch ((long)fp->f_pos) {
254 case 0: 247 case 0:
255 if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) 248 if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0)
@@ -265,10 +258,8 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler)
265 258
266 pos = fp->f_pos - 2; 259 pos = fp->f_pos - 2;
267 260
268 if (pos > VXFS_DIRROUND(ip->i_size)) { 261 if (pos > VXFS_DIRROUND(ip->i_size))
269 unlock_kernel();
270 return 0; 262 return 0;
271 }
272 263
273 npages = dir_pages(ip); 264 npages = dir_pages(ip);
274 nblocks = dir_blocks(ip); 265 nblocks = dir_blocks(ip);
@@ -327,6 +318,5 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler)
327done: 318done:
328 fp->f_pos = ((page << PAGE_CACHE_SHIFT) | offset) + 2; 319 fp->f_pos = ((page << PAGE_CACHE_SHIFT) | offset) + 2;
329out: 320out:
330 unlock_kernel();
331 return 0; 321 return 0;
332} 322}
diff --git a/fs/freevxfs/vxfs_olt.h b/fs/freevxfs/vxfs_olt.h
index d8324296486f..b7b3af502615 100644
--- a/fs/freevxfs/vxfs_olt.h
+++ b/fs/freevxfs/vxfs_olt.h
@@ -60,7 +60,7 @@ enum {
60 * 60 *
61 * The Object Location Table header is placed at the beginning of each 61 * The Object Location Table header is placed at the beginning of each
62 * OLT extent. It is used to fing certain filesystem-wide metadata, e.g. 62 * OLT extent. It is used to fing certain filesystem-wide metadata, e.g.
63 * the inital inode list, the fileset header or the device configuration. 63 * the initial inode list, the fileset header or the device configuration.
64 */ 64 */
65struct vxfs_olt { 65struct vxfs_olt {
66 u_int32_t olt_magic; /* magic number */ 66 u_int32_t olt_magic; /* magic number */
diff --git a/fs/freevxfs/vxfs_subr.c b/fs/freevxfs/vxfs_subr.c
index 1429f3ae1e86..5d318c44f855 100644
--- a/fs/freevxfs/vxfs_subr.c
+++ b/fs/freevxfs/vxfs_subr.c
@@ -44,7 +44,6 @@ static sector_t vxfs_bmap(struct address_space *, sector_t);
44const struct address_space_operations vxfs_aops = { 44const struct address_space_operations vxfs_aops = {
45 .readpage = vxfs_readpage, 45 .readpage = vxfs_readpage,
46 .bmap = vxfs_bmap, 46 .bmap = vxfs_bmap,
47 .sync_page = block_sync_page,
48}; 47};
49 48
50inline void 49inline void
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index dc0c041e85cb..9d1c99558389 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -38,7 +38,6 @@
38#include <linux/buffer_head.h> 38#include <linux/buffer_head.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/smp_lock.h>
42#include <linux/stat.h> 41#include <linux/stat.h>
43#include <linux/vfs.h> 42#include <linux/vfs.h>
44#include <linux/mount.h> 43#include <linux/mount.h>
@@ -81,16 +80,12 @@ vxfs_put_super(struct super_block *sbp)
81{ 80{
82 struct vxfs_sb_info *infp = VXFS_SBI(sbp); 81 struct vxfs_sb_info *infp = VXFS_SBI(sbp);
83 82
84 lock_kernel();
85
86 vxfs_put_fake_inode(infp->vsi_fship); 83 vxfs_put_fake_inode(infp->vsi_fship);
87 vxfs_put_fake_inode(infp->vsi_ilist); 84 vxfs_put_fake_inode(infp->vsi_ilist);
88 vxfs_put_fake_inode(infp->vsi_stilist); 85 vxfs_put_fake_inode(infp->vsi_stilist);
89 86
90 brelse(infp->vsi_bp); 87 brelse(infp->vsi_bp);
91 kfree(infp); 88 kfree(infp);
92
93 unlock_kernel();
94} 89}
95 90
96/** 91/**
@@ -148,7 +143,7 @@ static int vxfs_remount(struct super_block *sb, int *flags, char *data)
148 * The superblock on success, else %NULL. 143 * The superblock on success, else %NULL.
149 * 144 *
150 * Locking: 145 * Locking:
151 * We are under the bkl and @sbp->s_lock. 146 * We are under @sbp->s_lock.
152 */ 147 */
153static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent) 148static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
154{ 149{
@@ -251,17 +246,16 @@ out:
251/* 246/*
252 * The usual module blurb. 247 * The usual module blurb.
253 */ 248 */
254static int vxfs_get_sb(struct file_system_type *fs_type, 249static struct dentry *vxfs_mount(struct file_system_type *fs_type,
255 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 250 int flags, const char *dev_name, void *data)
256{ 251{
257 return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super, 252 return mount_bdev(fs_type, flags, dev_name, data, vxfs_fill_super);
258 mnt);
259} 253}
260 254
261static struct file_system_type vxfs_fs_type = { 255static struct file_system_type vxfs_fs_type = {
262 .owner = THIS_MODULE, 256 .owner = THIS_MODULE,
263 .name = "vxfs", 257 .name = "vxfs",
264 .get_sb = vxfs_get_sb, 258 .mount = vxfs_mount,
265 .kill_sb = kill_block_super, 259 .kill_sb = kill_block_super,
266 .fs_flags = FS_REQUIRES_DEV, 260 .fs_flags = FS_REQUIRES_DEV,
267}; 261};