X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fxfs%2Flinux-2.6%2Fxfs_iops.c;h=069dec8448ef31f93596aba51a62320cf68a4776;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=e7d4eba4c25ec43e36a6a820d6aeaa2213b90ea8;hpb=86090fcac5e27b630656fe3d963a6b80e26dac44;p=linux-2.6.git diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index e7d4eba4c..069dec844 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -67,6 +67,7 @@ #include "xfs_utils.h" #include +#include /* @@ -173,8 +174,9 @@ linvfs_mknod( */ teardown.d_inode = ip = LINVFS_GET_IP(vp); teardown.d_name = dentry->d_name; - remove_inode_hash(ip); - make_bad_inode(ip); + + vn_mark_bad(vp); + if (S_ISDIR(mode)) VOP_RMDIR(dvp, &teardown, NULL, err2); else @@ -224,26 +226,21 @@ linvfs_lookup( struct dentry *dentry, struct nameidata *nd) { - struct inode *ip = NULL; - vnode_t *vp, *cvp = NULL; + struct vnode *vp = LINVFS_GET_VP(dir), *cvp; int error; if (dentry->d_name.len >= MAXNAMELEN) return ERR_PTR(-ENAMETOOLONG); - vp = LINVFS_GET_VP(dir); VOP_LOOKUP(vp, dentry, &cvp, 0, NULL, NULL, error); - if (!error) { - ASSERT(cvp); - ip = LINVFS_GET_IP(cvp); - if (!ip) { - VN_RELE(cvp); - return ERR_PTR(-EACCES); - } + if (error) { + if (unlikely(error != ENOENT)) + return ERR_PTR(-error); + d_add(dentry, NULL); + return NULL; } - if (error && (error != ENOENT)) - return ERR_PTR(-error); - return d_splice_alias(ip, dentry); + + return d_splice_alias(LINVFS_GET_IP(cvp), dentry); } STATIC int @@ -303,7 +300,7 @@ linvfs_symlink( { struct inode *ip; vattr_t va; - vnode_t *dvp; /* directory containing name to remove */ + vnode_t *dvp; /* directory containing name of symlink */ vnode_t *cvp; /* used to lookup symlink to put in dentry */ int error; @@ -375,7 +372,7 @@ linvfs_rename( STATIC int linvfs_readlink( struct dentry *dentry, - char *buf, + char __user *buf, int size) { vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); @@ -497,6 +494,28 @@ linvfs_getattr( return 0; } +STATIC int +linvfs_setattr_flags( + vattr_t *vap, + unsigned int flags) +{ + unsigned int oldflags, newflags; + + oldflags = vap->va_xflags; + newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE | + XFS_XFLAG_IUNLINK | XFS_XFLAG_BARRIER); + if (flags & ATTR_FLAG_IMMUTABLE) + newflags |= XFS_XFLAG_IMMUTABLE; + if (flags & ATTR_FLAG_IUNLINK) + newflags |= XFS_XFLAG_IUNLINK; + if (flags & ATTR_FLAG_BARRIER) + newflags |= XFS_XFLAG_BARRIER; + + if (oldflags ^ newflags) + vap->va_xflags = newflags; + return 0; +} + STATIC int linvfs_setattr( struct dentry *dentry, @@ -548,6 +567,11 @@ linvfs_setattr( flags |= ATTR_NONBLOCK; #endif + if (ia_valid & ATTR_ATTR_FLAG) { + vattr.va_mask |= XFS_AT_XFLAGS; + linvfs_setattr_flags(&vattr, attr->ia_attr_flags); + } + VOP_SETATTR(vp, &vattr, flags, NULL, error); if (error) return -error;