X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fxfs%2Flinux-2.6%2Fxfs_super.c;h=3842eee2690254df8b6240d70e9aaa27af33c0de;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=eb81476f7f520cfd5c73a96f7eadf0219b89ce5e;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index eb81476f7..3842eee26 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -71,12 +71,10 @@ #include #include #include -#include #include STATIC struct quotactl_ops linvfs_qops; STATIC struct super_operations linvfs_sops; -STATIC struct export_operations linvfs_export_ops; STATIC kmem_zone_t *linvfs_inode_zone; STATIC kmem_shaker_t xfs_inode_shaker; @@ -242,6 +240,10 @@ xfs_initialize_vnode( vp->v_type = IFTOVT(ip->i_d.di_mode); xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip); xfs_set_inodeops(inode); + + ip->i_flags &= ~XFS_INEW; + barrier(); + unlock_new_inode(inode); } } @@ -292,7 +294,7 @@ linvfs_destroy_inode( kmem_cache_free(linvfs_inode_zone, LINVFS_GET_VP(inode)); } -int +STATIC int xfs_inode_shake( int priority, unsigned int gfp_mask) @@ -354,6 +356,12 @@ linvfs_write_inode( if (sync) flags |= FLUSH_SYNC; VOP_IFLUSH(vp, flags, error); + if (error == EAGAIN) { + if (sync) + VOP_IFLUSH(vp, flags | FLUSH_LOG, error); + else + error = 0; + } } return -error; @@ -493,8 +501,7 @@ xfssyncd( set_current_state(TASK_INTERRUPTIBLE); timeleft = schedule_timeout(timeleft); /* swsusp */ - if (current->flags & PF_FREEZE) - refrigerator(PF_FREEZE); + try_to_freeze(PF_FREEZE); if (vfsp->vfs_flag & VFS_UMOUNT) break; @@ -665,63 +672,6 @@ linvfs_freeze_fs( VFS_FREEZE(LINVFS_GET_VFS(sb)); } -STATIC struct dentry * -linvfs_get_parent( - struct dentry *child) -{ - int error; - vnode_t *vp, *cvp; - struct dentry *parent; - struct dentry dotdot; - - dotdot.d_name.name = ".."; - dotdot.d_name.len = 2; - dotdot.d_inode = NULL; - - cvp = NULL; - vp = LINVFS_GET_VP(child->d_inode); - VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); - if (unlikely(error)) - return ERR_PTR(-error); - - parent = d_alloc_anon(LINVFS_GET_IP(cvp)); - if (unlikely(!parent)) { - VN_RELE(cvp); - return ERR_PTR(-ENOMEM); - } - return parent; -} - -STATIC struct dentry * -linvfs_get_dentry( - struct super_block *sb, - void *data) -{ - vnode_t *vp; - struct inode *inode; - struct dentry *result; - xfs_fid2_t xfid; - vfs_t *vfsp = LINVFS_GET_VFS(sb); - int error; - - xfid.fid_len = sizeof(xfs_fid2_t) - sizeof(xfid.fid_len); - xfid.fid_pad = 0; - xfid.fid_gen = ((__u32 *)data)[1]; - xfid.fid_ino = ((__u32 *)data)[0]; - - VFS_VGET(vfsp, &vp, (fid_t *)&xfid, error); - if (error || vp == NULL) - return ERR_PTR(-ESTALE) ; - - inode = LINVFS_GET_IP(vp); - result = d_alloc_anon(inode); - if (!result) { - iput(inode); - return ERR_PTR(-ENOMEM); - } - return result; -} - STATIC int linvfs_show_options( struct seq_file *m, @@ -814,7 +764,9 @@ linvfs_fill_super( } sb_min_blocksize(sb, BBSIZE); +#ifdef CONFIG_XFS_EXPORT sb->s_export_op = &linvfs_export_ops; +#endif sb->s_qcop = &linvfs_qops; sb->s_op = &linvfs_sops; @@ -833,6 +785,7 @@ linvfs_fill_super( sb->s_blocksize = statvfs.f_bsize; sb->s_blocksize_bits = ffs(statvfs.f_bsize) - 1; sb->s_maxbytes = xfs_max_file_offset(sb->s_blocksize_bits); + sb->s_time_gran = 1; set_posix_acl_flag(sb); VFS_ROOT(vfsp, &rootvp, error); @@ -882,12 +835,6 @@ linvfs_get_sb( return get_sb_bdev(fs_type, flags, dev_name, data, linvfs_fill_super); } - -STATIC struct export_operations linvfs_export_ops = { - .get_parent = linvfs_get_parent, - .get_dentry = linvfs_get_dentry, -}; - STATIC struct super_operations linvfs_sops = { .alloc_inode = linvfs_alloc_inode, .destroy_inode = linvfs_destroy_inode, @@ -952,10 +899,6 @@ init_xfs_fs( void ) goto undo_shaker; } - error = xfs_ioctl32_init(); - if (error) - goto undo_ioctl32; - error = register_filesystem(&xfs_fs_type); if (error) goto undo_register; @@ -963,9 +906,6 @@ init_xfs_fs( void ) return 0; undo_register: - xfs_ioctl32_exit(); - -undo_ioctl32: kmem_shake_deregister(xfs_inode_shaker); undo_shaker: @@ -984,7 +924,6 @@ exit_xfs_fs( void ) vfs_exitquota(); XFS_DM_EXIT(&xfs_fs_type); unregister_filesystem(&xfs_fs_type); - xfs_ioctl32_exit(); kmem_shake_deregister(xfs_inode_shaker); xfs_cleanup(); pagebuf_terminate();