Commit 85493d69 authored by Stephen Lord's avatar Stephen Lord Committed by Christoph Hellwig

XFS: Rework dev_t and linux inode handling

This is a two fold change, first it moves the translation between
linux dev_t and kdev_t up the call stack in xfs and makes the bulk
of xfs work in terms of its on disk dev_t format.  It also cleans
up a few related chunks of code.
   
The other part of the change reworks how we keep the linux inode
contents and the xfs inode fields in sync. A number of places where
we resynced the two have been removed, these were basically
replicating work elsewhere in the filesystem.   We now also ensure
that the inode fields are filled in before calling unlock_new_inode -
there used to be a window.

Finally all the code which hooks together the linux inode and the xfs
inode is brought together as a more coherent whole rather than being
cattered around the inode create path. Most calls to revalidate the
linux inode from the xfs inode are removed.

Modid: 2.5.x-xfs:slinx:128899a 10/02/02
parent 6ec8464d
......@@ -264,12 +264,6 @@ xfs_vget_fsop_handlereq(
vpp = XFS_ITOV(ip);
inodep = LINVFS_GET_IP(vpp);
xfs_iunlock(ip, XFS_ILOCK_SHARED);
error = linvfs_revalidate_core(inodep, ATTR_COMM);
if (error) {
iput(inodep);
/* this error is (-) but our callers expect + */
return XFS_ERROR(-error);
}
*vp = vpp;
*inode = inodep;
......
......@@ -98,7 +98,7 @@ linvfs_mknod(
switch (mode & S_IFMT) {
case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK:
va.va_rdev = rdev;
va.va_rdev = XFS_MKDEV(MAJOR(rdev), MINOR(rdev));
va.va_mask |= AT_RDEV;
/*FALLTHROUGH*/
case S_IFREG:
......@@ -122,8 +122,6 @@ linvfs_mknod(
if (S_ISCHR(mode) || S_ISBLK(mode))
ip->i_rdev = to_kdev_t(rdev);
/* linvfs_revalidate_core returns (-) errors */
error = -linvfs_revalidate_core(ip, ATTR_COMM);
validate_fields(dir);
d_instantiate(dentry, ip);
mark_inode_dirty_sync(ip);
......@@ -186,7 +184,6 @@ linvfs_lookup(
VN_RELE(cvp);
return ERR_PTR(-EACCES);
}
error = -linvfs_revalidate_core(ip, ATTR_COMM);
}
if (error && (error != ENOENT))
return ERR_PTR(-error);
......@@ -278,8 +275,6 @@ linvfs_symlink(
error = ENOMEM;
VN_RELE(cvp);
} else {
/* linvfs_revalidate_core returns (-) errors */
error = -linvfs_revalidate_core(ip, ATTR_COMM);
d_instantiate(dentry, ip);
validate_fields(dir);
mark_inode_dirty_sync(ip);
......@@ -441,16 +436,6 @@ linvfs_permission(
* from the results of a getattr. This gets called out of things
* like stat.
*/
int
linvfs_revalidate_core(
struct inode *inode,
int flags)
{
vnode_t *vp = LINVFS_GET_VP(inode);
/* vn_revalidate returns (-) error so this is ok */
return vn_revalidate(vp, flags);
}
STATIC int
linvfs_getattr(
......@@ -463,7 +448,7 @@ linvfs_getattr(
int error = 0;
if (unlikely(vp->v_flag & VMODIFIED)) {
error = linvfs_revalidate_core(inode, 0);
error = vn_revalidate(vp);
}
if (!error)
generic_fillattr(inode, stat);
......@@ -528,7 +513,7 @@ linvfs_setattr(
}
if (!error) {
vn_revalidate(vp, 0);
vn_revalidate(vp);
mark_inode_dirty_sync(inode);
}
return error;
......@@ -618,30 +603,17 @@ linvfs_setxattr(
error = -ENOATTR;
p += xfs_namespaces[SYSTEM_NAMES].namelen;
if (strcmp(p, POSIXACL_ACCESS) == 0) {
if (vp->v_flag & VMODIFIED) {
error = linvfs_revalidate_core(inode, 0);
if (error)
return error;
}
error = xfs_acl_vset(vp, data, size, _ACL_TYPE_ACCESS);
if (!error) {
VMODIFY(vp);
error = linvfs_revalidate_core(inode, 0);
}
}
else if (strcmp(p, POSIXACL_DEFAULT) == 0) {
error = linvfs_revalidate_core(inode, 0);
if (error)
return error;
error = xfs_acl_vset(vp, data, size, _ACL_TYPE_DEFAULT);
if (!error) {
VMODIFY(vp);
error = linvfs_revalidate_core(inode, 0);
}
}
else if (strcmp(p, POSIXCAP) == 0) {
error = xfs_cap_vset(vp, data, size);
}
if (!error) {
error = vn_revalidate(vp);
}
return error;
}
......@@ -689,19 +661,9 @@ linvfs_getxattr(
error = -ENOATTR;
p += xfs_namespaces[SYSTEM_NAMES].namelen;
if (strcmp(p, POSIXACL_ACCESS) == 0) {
if (vp->v_flag & VMODIFIED) {
error = linvfs_revalidate_core(inode, 0);
if (error)
return error;
}
error = xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS);
}
else if (strcmp(p, POSIXACL_DEFAULT) == 0) {
if (vp->v_flag & VMODIFIED) {
error = linvfs_revalidate_core(inode, 0);
if (error)
return error;
}
error = xfs_acl_vget(vp, data, size, _ACL_TYPE_DEFAULT);
}
else if (strcmp(p, POSIXCAP) == 0) {
......
......@@ -65,7 +65,6 @@ extern struct file_operations linvfs_dir_operations;
extern struct address_space_operations linvfs_aops;
extern int linvfs_revalidate_core(struct inode *, int);
extern int linvfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
#endif /* __XFS_IOPS_H__ */
......@@ -390,7 +390,6 @@ linvfs_fill_super(
goto fail_unmount;
ip = LINVFS_GET_IP(rootvp);
linvfs_revalidate_core(ip, ATTR_COMM);
sb->s_root = d_alloc_root(ip);
if (!sb->s_root)
......@@ -444,12 +443,6 @@ linvfs_set_inode_ops(
{
vnode_t *vp = LINVFS_GET_VP(inode);
inode->i_mode = VTTOIF(vp->v_type);
/* If this isn't a new inode, nothing to do */
if (!(inode->i_state & I_NEW))
return;
if (vp->v_type == VNON) {
make_bad_inode(inode);
} else if (S_ISREG(inode->i_mode)) {
......@@ -468,8 +461,6 @@ linvfs_set_inode_ops(
init_special_inode(inode, inode->i_mode,
kdev_t_to_nr(inode->i_rdev));
}
unlock_new_inode(inode);
}
/*
......@@ -530,8 +521,8 @@ void
linvfs_put_super(
struct super_block *sb)
{
vfs_t *vfsp = LINVFS_GET_VFS(sb);
int error;
vfs_t *vfsp = LINVFS_GET_VFS(sb);
VFS_DOUNMOUNT(vfsp, 0, NULL, NULL, error);
if (error) {
......@@ -674,7 +665,6 @@ linvfs_get_parent(
VN_RELE(cvp);
return ERR_PTR(-EACCES);
}
error = -linvfs_revalidate_core(ip, ATTR_COMM);
}
if (error)
return ERR_PTR(-error);
......
......@@ -92,6 +92,8 @@ typedef struct vfsops {
/* send dmapi mount event */
int (*vfs_dmapi_fsys_vector)(bhv_desc_t *,
struct dm_fcntl_vector *);
void (*vfs_init_vnode)(bhv_desc_t *, struct vnode *,
bhv_desc_t *, int);
void (*vfs_force_shutdown)(bhv_desc_t *,
int, char *, int);
} vfsops_t;
......@@ -132,6 +134,14 @@ typedef struct vfsops {
rv = (*(VFS_FOPS(vfsp)->vfs_vget))((vfsp)->vfs_fbhv, vpp, fidp); \
BHV_READ_UNLOCK(&(vfsp)->vfs_bh); \
}
#define VFS_INIT_VNODE(vfsp, vp, bhv, unlock) \
{ \
BHV_READ_LOCK(&(vfsp)->vfs_bh); \
(*(VFS_FOPS(vfsp)->vfs_init_vnode))((vfsp)->vfs_fbhv, vp, bhv, unlock);\
BHV_READ_UNLOCK(&(vfsp)->vfs_bh); \
}
/* No behavior lock here */
#define VFS_FORCE_SHUTDOWN(vfsp, flags) \
(*(VFS_FOPS(vfsp)->vfs_force_shutdown))((vfsp)->vfs_fbhv, flags, __FILE__, __LINE__);
......
......@@ -203,7 +203,7 @@ vn_get(struct vnode *vp, vmap_t *vmap)
* "revalidate" the linux inode.
*/
int
vn_revalidate(struct vnode *vp, int flags)
vn_revalidate(struct vnode *vp)
{
int error;
struct inode *inode;
......@@ -215,7 +215,7 @@ vn_revalidate(struct vnode *vp, int flags)
ASSERT(vp->v_bh.bh_first != NULL);
VOP_GETATTR(vp, &va, flags & ATTR_LAZY, NULL, error);
VOP_GETATTR(vp, &va, 0, NULL, error);
if (! error) {
inode = LINVFS_GET_IP(vp);
......@@ -225,27 +225,14 @@ vn_revalidate(struct vnode *vp, int flags)
inode->i_nlink = va.va_nlink;
inode->i_uid = va.va_uid;
inode->i_gid = va.va_gid;
inode->i_rdev = mk_kdev(MAJOR(va.va_rdev),
MINOR(va.va_rdev));
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_rdev = XFS_DEV_TO_KDEVT(va.va_rdev);
inode->i_generation = va.va_gencount;
if ((flags & ATTR_COMM) ||
S_ISREG(inode->i_mode) ||
S_ISDIR(inode->i_mode) ||
S_ISLNK(inode->i_mode)) {
inode->i_size = va.va_size;
inode->i_blocks = va.va_nblocks;
inode->i_atime = va.va_atime.tv_sec;
inode->i_mtime = va.va_mtime.tv_sec;
inode->i_ctime = va.va_ctime.tv_sec;
}
if (flags & ATTR_LAZY)
vp->v_flag &= ~VMODIFIED;
else
VUNMODIFY(vp);
} else {
vn_trace_exit(vp, "vn_revalidate.error",
(inst_t *)__return_address);
inode->i_size = va.va_size;
inode->i_blocks = va.va_nblocks;
inode->i_mtime = va.va_mtime.tv_sec;
inode->i_ctime = va.va_ctime.tv_sec;
inode->i_atime = va.va_atime.tv_sec;
VUNMODIFY(vp);
}
return -error;
......
......@@ -528,14 +528,14 @@ typedef struct vattr {
mode_t va_mode; /* file access mode */
uid_t va_uid; /* owner user id */
gid_t va_gid; /* owner group id */
dev_t va_fsid; /* file system id (dev for now) */
xfs_dev_t va_fsid; /* file system id (dev for now) */
xfs_ino_t va_nodeid; /* node id */
nlink_t va_nlink; /* number of references to file */
xfs_off_t va_size; /* file size in bytes */
timespec_t va_atime; /* time of last access */
timespec_t va_mtime; /* time of last modification */
timespec_t va_ctime; /* time file ``created'' */
dev_t va_rdev; /* device the file represents */
xfs_dev_t va_rdev; /* device the file represents */
u_long va_blksize; /* fundamental block size */
__int64_t va_nblocks; /* # of blocks allocated */
u_long va_vcode; /* version code */
......@@ -642,7 +642,7 @@ typedef struct vnode_map {
(vmap).v_ino = (ip)->i_ino; }
extern void vn_purge(struct vnode *, vmap_t *);
extern vnode_t *vn_get(struct vnode *, vmap_t *);
extern int vn_revalidate(struct vnode *, int);
extern int vn_revalidate(struct vnode *);
extern void vn_remove(struct vnode *);
static inline int vn_count(struct vnode *vp)
......
......@@ -31,6 +31,7 @@
*/
#include <xfs.h>
#include <linux/pagemap.h>
/*
......@@ -109,17 +110,35 @@ xfs_chash_free(xfs_mount_t *mp)
mp->m_chash = NULL;
}
static inline void
xfs_iget_vnode_init(
void
xfs_revalidate_inode(
xfs_mount_t *mp,
vnode_t *vp,
xfs_inode_t *ip)
{
vp->v_vfsp = XFS_MTOVFS(mp);
vp->v_type = IFTOVT(ip->i_d.di_mode);
}
struct inode *inode = LINVFS_GET_IP(vp);
inode->i_mode = (ip->i_d.di_mode & MODEMASK) | VTTOIF(vp->v_type);
inode->i_nlink = ip->i_d.di_nlink;
inode->i_uid = ip->i_d.di_uid;
inode->i_gid = ip->i_d.di_gid;
if (((1 << vp->v_type) & ((1<<VBLK) | (1<<VCHR))) == 0) {
inode->i_rdev = NODEV;
} else {
xfs_dev_t dev = ip->i_df.if_u2.if_rdev;
inode->i_rdev = XFS_DEV_TO_KDEVT(dev);
}
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_generation = ip->i_d.di_gen;
inode->i_size = ip->i_d.di_size;
inode->i_blocks =
XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
inode->i_atime = ip->i_d.di_atime.t_sec;
inode->i_mtime = ip->i_d.di_mtime.t_sec;
inode->i_ctime = ip->i_d.di_ctime.t_sec;
vp->v_flag &= ~VMODIFIED;
}
/*
* Look up an inode by number in the given file system.
......@@ -198,16 +217,9 @@ xfs_iget_core(
goto again;
}
xfs_iget_vnode_init(mp, vp, ip);
vn_trace_exit(vp, "xfs_iget.alloc",
(inst_t *)__return_address);
bhv_desc_init(&(ip->i_bhv_desc), ip, vp,
&xfs_vnodeops);
vn_bhv_insert_initial(VN_BHV_HEAD(vp),
&(ip->i_bhv_desc));
XFS_STATS_INC(xfsstats.xs_ig_found);
read_unlock(&ih->ih_lock);
......@@ -240,11 +252,6 @@ xfs_iget_core(
XFS_STATS_INC(xfsstats.xs_ig_found);
/*
* Make sure the vnode and the inode are hooked up
*/
xfs_iget_vnode_init(mp, vp, ip);
finish_inode:
if (lock_flags != 0) {
xfs_ilock(ip, lock_flags);
......@@ -281,19 +288,8 @@ xfs_iget_core(
return error;
}
/*
* Vnode provided by vn_initialize.
*/
xfs_iget_vnode_init(mp, vp, ip);
vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address);
if (vp->v_fbhv == NULL) {
bhv_desc_init(&(ip->i_bhv_desc), ip, vp, &xfs_vnodeops);
vn_bhv_insert_initial(VN_BHV_HEAD(vp), &(ip->i_bhv_desc));
}
xfs_inode_lock_init(ip, vp);
xfs_iocore_inode_init(ip);
......@@ -426,12 +422,7 @@ xfs_iget_core(
* If we have a real type for an on-disk inode, we can set ops(&unlock)
* now. If it's a new inode being created, xfs_ialloc will handle it.
*/
if (vp->v_type != VNON) {
linvfs_set_inode_ops(LINVFS_GET_IP(vp));
}
/* Update the linux inode */
error = vn_revalidate(vp, ATTR_COMM|ATTR_LAZY);
VFS_INIT_VNODE(XFS_MTOVFS(mp), vp, XFS_ITOBHV(ip), 1);
return 0;
}
......@@ -496,7 +487,6 @@ xfs_iget(
newnode = (ip->i_d.di_mode == 0);
if (newnode)
xfs_iocore_inode_reinit(ip);
vn_revalidate(vp, ATTR_COMM|ATTR_LAZY);
XFS_STATS_INC(xfsstats.xs_ig_found);
*ipp = ip;
error = 0;
......@@ -507,7 +497,6 @@ xfs_iget(
return error;
}
/*
* Do the setup for the various locks within the incore inode.
*/
......
......@@ -1015,7 +1015,7 @@ xfs_ialloc(
xfs_inode_t *pip,
mode_t mode,
nlink_t nlink,
dev_t rdev,
xfs_dev_t rdev,
cred_t *cr,
xfs_prid_t prid,
int okalloc,
......@@ -1067,9 +1067,6 @@ xfs_ialloc(
ip->i_d.di_projid = prid;
bzero(&(ip->i_d.di_pad[0]), sizeof(ip->i_d.di_pad));
/* now that we have a v_type we can set Linux inode ops (& unlock) */
linvfs_set_inode_ops(LINVFS_GET_IP(XFS_ITOV(ip)));
/*
* If the superblock version is up to where we support new format
* inodes and this is currently an old format inode, then change
......@@ -1128,7 +1125,7 @@ xfs_ialloc(
case IFBLK:
case IFSOCK:
ip->i_d.di_format = XFS_DINODE_FMT_DEV;
ip->i_df.if_u2.if_rdev = IRIX_MKDEV(MAJOR(rdev), MINOR(rdev));
ip->i_df.if_u2.if_rdev = rdev;
ip->i_df.if_flags = 0;
flags |= XFS_ILOG_DEV;
break;
......@@ -1172,6 +1169,10 @@ xfs_ialloc(
* Log the new values stuffed into the inode.
*/
xfs_trans_log_inode(tp, ip, flags);
/* now that we have a v_type we can set Linux inode ops (& unlock) */
VFS_INIT_VNODE(XFS_MTOVFS(tp->t_mountp), vp, XFS_ITOBHV(ip), 1);
*ipp = ip;
return 0;
}
......
......@@ -516,7 +516,7 @@ int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
xfs_inode_t **, xfs_daddr_t);
int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int);
int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, nlink_t,
dev_t, struct cred *, xfs_prid_t, int,
xfs_dev_t, struct cred *, xfs_prid_t, int,
struct xfs_buf **, boolean_t *, xfs_inode_t **);
void xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, int,
xfs_arch_t);
......@@ -550,7 +550,7 @@ void xfs_lock_inodes(xfs_inode_t **, int, int, uint);
#define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount))
void xfs_revalidate_inode(struct xfs_mount *, vnode_t *vp, xfs_inode_t *);
#ifdef DEBUG
void xfs_isize_check(struct xfs_mount *, xfs_inode_t *, xfs_fsize_t);
......
......@@ -1429,7 +1429,7 @@ xfs_qm_qino_alloc(
}
bzero(&zerocr, sizeof(zerocr));
if ((error = xfs_dir_ialloc(&tp, mp->m_rootip, IFREG, 1, mp->m_dev,
if ((error = xfs_dir_ialloc(&tp, mp->m_rootip, IFREG, 1, 0,
&zerocr, 0, 1, ip, &committed))) {
xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
XFS_TRANS_ABORT);
......
......@@ -315,16 +315,16 @@ extern struct xfsstats xfsstats;
#define MKDEV(major, minor) makedev(major, minor)
#endif
#define IRIX_DEV_BITSMAJOR 14
#define IRIX_DEV_BITSMINOR 18
#define IRIX_DEV_MAXMAJ 0x1ff
#define IRIX_DEV_MAXMIN 0x3ffff
#define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev)>>IRIX_DEV_BITSMINOR) \
& IRIX_DEV_MAXMAJ))
#define IRIX_DEV_MINOR(dev) ((int)((dev)&IRIX_DEV_MAXMIN))
#define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major)<<IRIX_DEV_BITSMINOR) \
| (minor&IRIX_DEV_MAXMIN)))
#define IRIX_DEV_TO_KDEVT(dev) MKDEV(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
#define XFS_DEV_BITSMAJOR 14
#define XFS_DEV_BITSMINOR 18
#define XFS_DEV_MAXMAJ 0x1ff
#define XFS_DEV_MAXMIN 0x3ffff
#define XFS_DEV_MAJOR(dev) ((int)(((unsigned)(dev)>>XFS_DEV_BITSMINOR) \
& XFS_DEV_MAXMAJ))
#define XFS_DEV_MINOR(dev) ((int)((dev)&XFS_DEV_MAXMIN))
#define XFS_MKDEV(major,minor) ((xfs_dev_t)(((major)<<XFS_DEV_BITSMINOR) \
| (minor&XFS_DEV_MAXMIN)))
#define XFS_DEV_TO_KDEVT(dev) mk_kdev(XFS_DEV_MAJOR(dev),XFS_DEV_MINOR(dev))
#endif /* !__XFS_TYPES_H */
......@@ -132,7 +132,7 @@ xfs_dir_ialloc(
the inode. */
mode_t mode,
nlink_t nlink,
dev_t rdev,
xfs_dev_t rdev,
cred_t *credp,
prid_t prid, /* project id */
int okalloc, /* ok to allocate new space */
......
......@@ -76,7 +76,7 @@ xfs_dir_ialloc(
struct xfs_inode *dp,
mode_t mode,
nlink_t nlink,
dev_t rdev,
xfs_dev_t rdev,
struct cred *credp,
prid_t prid,
int okalloc,
......
......@@ -1571,6 +1571,39 @@ xfs_syncsub(
return XFS_ERROR(last_error);
}
STATIC void
xfs_initialize_vnode(
bhv_desc_t *bdp,
vnode_t *vp,
bhv_desc_t *inode_bhv,
int unlock)
{
xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
struct inode *inode = LINVFS_GET_IP(vp);
if (vp->v_fbhv == NULL) {
vp->v_vfsp = bhvtovfs(bdp);
bhv_desc_init(&(ip->i_bhv_desc), ip, vp, &xfs_vnodeops);
bhv_insert_initial(VN_BHV_HEAD(vp), &(ip->i_bhv_desc));
}
vp->v_type = IFTOVT(ip->i_d.di_mode);
/* Have we been called during the new inode create process,
* in which case we are too early to fill in the linux inode.
*/
if (vp->v_type == VNON)
return;
xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
/* For new inodes we need to set the ops vectors,
* and unlock the inode.
*/
if (unlock && (inode->i_state & I_NEW)) {
linvfs_set_inode_ops(inode);
unlock_new_inode(inode);
}
}
/*
* xfs_vget - called by DMAPI to get vnode from file handle
......@@ -1623,11 +1656,6 @@ xfs_vget(
inode = LINVFS_GET_IP((*vpp));
xfs_iunlock(ip, XFS_ILOCK_SHARED);
error = linvfs_revalidate_core(inode, ATTR_COMM);
if (error) {
iput(inode);
return XFS_ERROR(error);
}
return 0;
}
......@@ -1640,6 +1668,7 @@ vfsops_t xfs_vfsops = {
.vfs_statvfs = xfs_statvfs,
.vfs_sync = xfs_sync,
.vfs_vget = xfs_vget,
.vfs_init_vnode = xfs_initialize_vnode,
.vfs_force_shutdown = xfs_do_force_shutdown,
#ifdef CONFIG_XFS_DMAPI
.vfs_dmapi_mount = xfs_dm_mount,
......
......@@ -208,7 +208,7 @@ xfs_getattr(
(mp->m_sb.sb_rextsize << mp->m_sb.sb_blocklog);
}
} else {
vap->va_rdev = IRIX_DEV_TO_KDEVT(ip->i_df.if_u2.if_rdev);
vap->va_rdev = ip->i_df.if_u2.if_rdev;
vap->va_blksize = BLKDEV_IOSIZE;
}
......@@ -1970,7 +1970,7 @@ xfs_create(
vnode_t *vp=NULL;
xfs_trans_t *tp;
xfs_mount_t *mp;
dev_t rdev;
xfs_dev_t rdev;
int error;
xfs_bmap_free_t free_list;
xfs_fsblock_t first_block;
......@@ -2955,8 +2955,7 @@ xfs_mkdir(
xfs_inode_t *cdp; /* inode of created dir */
vnode_t *cvp; /* vnode of created dir */
xfs_trans_t *tp;
dev_t rdev;
mode_t mode;
xfs_dev_t rdev;
xfs_mount_t *mp;
int cancel_flags;
int error;
......@@ -3062,8 +3061,9 @@ xfs_mkdir(
* create the directory inode.
*/
rdev = (vap->va_mask & AT_RDEV) ? vap->va_rdev : 0;
mode = IFDIR | (vap->va_mode & ~IFMT);
error = xfs_dir_ialloc(&tp, dp, mode, 2, rdev, credp, prid, resblks > 0,
error = xfs_dir_ialloc(&tp, dp,
MAKEIMODE(vap->va_type,vap->va_mode), 2,
rdev, credp, prid, resblks > 0,
&cdp, NULL);
if (error) {
if (error == ENOSPC)
......@@ -3521,7 +3521,7 @@ xfs_symlink(
xfs_inode_t *ip;
int error;
int pathlen;
dev_t rdev;
xfs_dev_t rdev;
xfs_bmap_free_t free_list;
xfs_fsblock_t first_block;
boolean_t dp_joined_to_trans;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment