STATIC int xfs_vn_link( struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) { struct inode *inode; /* inode of guy being linked to */ struct xfs_name name; int error; inode = old_dentry->d_inode; xfs_dentry_to_name(&name, dentry); igrab(inode); error = xfs_link(XFS_I(dir), XFS_I(inode), &name); if (unlikely(error)) { iput(inode); return -error; } xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED); xfs_validate_fields(inode); d_instantiate(dentry, inode); return 0; }
STATIC int xfs_vn_link( struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) { struct inode *inode = old_dentry->d_inode; struct xfs_name name; int error; xfs_dentry_to_name(&name, dentry); error = xfs_link(XFS_I(dir), XFS_I(inode), &name); if (unlikely(error)) return -error; ihold(inode); d_instantiate(dentry, inode); return 0; }
STATIC int xfs_vn_link( struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) { struct inode *ip; /* inode of guy being linked to */ bhv_vnode_t *vp; /* vp of name being linked */ int error; ip = old_dentry->d_inode; /* inode being linked to */ vp = vn_from_inode(ip); VN_HOLD(vp); error = xfs_link(XFS_I(dir), vp, dentry); if (unlikely(error)) { VN_RELE(vp); } else { xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED); xfs_validate_fields(ip); d_instantiate(dentry, ip); } return -error; }