Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89384
b: refs/heads/master
c: 979ebab
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Lachlan McIlroy committed Apr 18, 2008
1 parent 60a55b9 commit 31a9ab1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc4ac74a4e5bd7db02976eb1b681e1d11f81c9ce
refs/heads/master: 979ebab11623894528d4d37b947533ea4e8649d1
21 changes: 11 additions & 10 deletions trunk/fs/xfs/linux-2.6/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ xfs_vn_mknod(
dev_t rdev)
{
struct inode *inode;
bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir);
struct xfs_inode *ip = NULL;
xfs_acl_t *default_acl = NULL;
attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS;
int error;
Expand All @@ -285,11 +285,11 @@ xfs_vn_mknod(
if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff))
return -EINVAL;

if (test_default_acl && test_default_acl(dvp)) {
if (test_default_acl && test_default_acl(dir)) {
if (!_ACL_ALLOC(default_acl)) {
return -ENOMEM;
}
if (!_ACL_GET_DEFAULT(dvp, default_acl)) {
if (!_ACL_GET_DEFAULT(dir, default_acl)) {
_ACL_FREE(default_acl);
default_acl = NULL;
}
Expand All @@ -305,10 +305,10 @@ xfs_vn_mknod(
case S_IFSOCK:
rdev = sysv_encode_dev(rdev);
case S_IFREG:
error = xfs_create(XFS_I(dir), dentry, mode, rdev, &vp, NULL);
error = xfs_create(XFS_I(dir), dentry, mode, rdev, &ip, NULL);
break;
case S_IFDIR:
error = xfs_mkdir(XFS_I(dir), dentry, mode, &vp, NULL);
error = xfs_mkdir(XFS_I(dir), dentry, mode, &ip, NULL);
break;
default:
error = EINVAL;
Expand All @@ -318,19 +318,20 @@ xfs_vn_mknod(
if (unlikely(error))
goto out_free_acl;

error = xfs_init_security(vp, dir);
inode = ip->i_vnode;

error = xfs_init_security(inode, dir);
if (unlikely(error))
goto out_cleanup_inode;

if (default_acl) {
error = _ACL_INHERIT(vp, mode, default_acl);
error = _ACL_INHERIT(inode, mode, default_acl);
if (unlikely(error))
goto out_cleanup_inode;
xfs_iflags_set(XFS_I(vp), XFS_IMODIFIED);
xfs_iflags_set(ip, XFS_IMODIFIED);
_ACL_FREE(default_acl);
}

inode = vn_to_inode(vp);

if (S_ISDIR(mode))
xfs_validate_fields(inode);
Expand All @@ -339,7 +340,7 @@ xfs_vn_mknod(
return -error;

out_cleanup_inode:
xfs_cleanup_inode(dir, vp, dentry, mode);
xfs_cleanup_inode(dir, inode, dentry, mode);
out_free_acl:
if (default_acl)
_ACL_FREE(default_acl);
Expand Down
25 changes: 9 additions & 16 deletions trunk/fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,14 +1791,12 @@ xfs_create(
bhv_vname_t *dentry,
mode_t mode,
xfs_dev_t rdev,
bhv_vnode_t **vpp,
xfs_inode_t **ipp,
cred_t *credp)
{
char *name = VNAME(dentry);
xfs_mount_t *mp = dp->i_mount;
bhv_vnode_t *dir_vp = XFS_ITOV(dp);
xfs_inode_t *ip;
bhv_vnode_t *vp = NULL;
xfs_trans_t *tp;
int error;
xfs_bmap_free_t free_list;
Expand All @@ -1812,7 +1810,7 @@ xfs_create(
uint resblks;
int namelen;

ASSERT(!*vpp);
ASSERT(!*ipp);
xfs_itrace_entry(dp);

namelen = VNAMELEN(dentry);
Expand Down Expand Up @@ -1911,7 +1909,7 @@ xfs_create(
* the transaction cancel unlocking dp so don't do it explicitly in the
* error path.
*/
VN_HOLD(dir_vp);
IHOLD(dp);
xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
unlock_dp_on_error = B_FALSE;

Expand Down Expand Up @@ -1949,7 +1947,6 @@ xfs_create(
* vnode to the caller, we bump the vnode ref count now.
*/
IHOLD(ip);
vp = XFS_ITOV(ip);

error = xfs_bmap_finish(&tp, &free_list, &committed);
if (error) {
Expand All @@ -1967,16 +1964,16 @@ xfs_create(
XFS_QM_DQRELE(mp, udqp);
XFS_QM_DQRELE(mp, gdqp);

*vpp = vp;
*ipp = ip;

/* Fallthrough to std_return with error = 0 */

std_return:
if ((*vpp || (error != 0 && dm_event_sent != 0)) &&
if ((*ipp || (error != 0 && dm_event_sent != 0)) &&
DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) {
(void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE,
dp, DM_RIGHT_NULL,
*vpp ? ip : NULL,
*ipp ? ip : NULL,
DM_RIGHT_NULL, name, NULL,
mode, error, 0);
}
Expand Down Expand Up @@ -2634,15 +2631,13 @@ xfs_mkdir(
xfs_inode_t *dp,
bhv_vname_t *dentry,
mode_t mode,
bhv_vnode_t **vpp,
xfs_inode_t **ipp,
cred_t *credp)
{
bhv_vnode_t *dir_vp = XFS_ITOV(dp);
char *dir_name = VNAME(dentry);
int dir_namelen = VNAMELEN(dentry);
xfs_mount_t *mp = dp->i_mount;
xfs_inode_t *cdp; /* inode of created dir */
bhv_vnode_t *cvp; /* vnode of created dir */
xfs_trans_t *tp;
int cancel_flags;
int error;
Expand Down Expand Up @@ -2749,7 +2744,7 @@ xfs_mkdir(
* from here on will result in the transaction cancel
* unlocking dp so don't do it explicitly in the error path.
*/
VN_HOLD(dir_vp);
IHOLD(dp);
xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
unlock_dp_on_error = B_FALSE;

Expand Down Expand Up @@ -2780,11 +2775,9 @@ xfs_mkdir(
if (error)
goto error2;

cvp = XFS_ITOV(cdp);

created = B_TRUE;

*vpp = cvp;
*ipp = cdp;
IHOLD(cdp);

/*
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/xfs_vnodeops.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ int xfs_inactive(struct xfs_inode *ip);
int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry,
bhv_vnode_t **vpp);
int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode,
xfs_dev_t rdev, bhv_vnode_t **vpp, struct cred *credp);
xfs_dev_t rdev, struct xfs_inode **ipp, struct cred *credp);
int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry);
int xfs_link(struct xfs_inode *tdp, bhv_vnode_t *src_vp,
bhv_vname_t *dentry);
int xfs_mkdir(struct xfs_inode *dp, bhv_vname_t *dentry,
mode_t mode, bhv_vnode_t **vpp, struct cred *credp);
mode_t mode, struct xfs_inode **ipp, struct cred *credp);
int xfs_rmdir(struct xfs_inode *dp, bhv_vname_t *dentry);
int xfs_readdir(struct xfs_inode *dp, void *dirent, size_t bufsize,
xfs_off_t *offset, filldir_t filldir);
Expand Down

0 comments on commit 31a9ab1

Please sign in to comment.