/*
* di_mode is a 16-bit uint so no need to check the < 0 case
*/
- if ((((dic->di_mode & IFMT) >> 12) > 15) ||
- (!(okfmts[(dic->di_mode & IFMT) >> 12] & (1 << dic->di_format)))) {
+ if ((((dic->di_mode & S_IFMT) >> 12) > 15) ||
+ (!(okfmts[(dic->di_mode & S_IFMT) >> 12] & (1 << dic->di_format)))) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
dbprintf("bad format %d for inode %lld type %#o\n",
- dic->di_format, id->ino, dic->di_mode & IFMT);
+ dic->di_format, id->ino, dic->di_mode & S_IFMT);
error++;
return;
}
dic->di_flags & XFS_DIFLAG_NOATIME ? " noa" : "",
dic->di_flags & XFS_DIFLAG_NODUMP ? " nod" : "");
security = 0;
- switch (dic->di_mode & IFMT) {
- case IFDIR:
+ switch (dic->di_mode & S_IFMT) {
+ case S_IFDIR:
type = DBM_DIR;
if (dic->di_format == XFS_DINODE_FMT_LOCAL)
break;
blkmap = blkmap_alloc(dic->di_nextents);
break;
- case IFREG:
+ case S_IFREG:
if (dic->di_flags & XFS_DIFLAG_REALTIME)
type = DBM_RTDATA;
else if (id->ino == mp->m_sb.sb_rbmino) {
}
else
type = DBM_DATA;
- if (dic->di_mode & (ISUID | ISGID))
+ if (dic->di_mode & (S_ISUID | S_ISGID))
security = 1;
break;
- case IFLNK:
+ case S_IFLNK:
type = DBM_SYMLINK;
break;
default:
dic = &dip->di_core;
ino = XFS_AGINO_TO_INO(mp, INT_GET(agf->agf_seqno, ARCH_CONVERT), agino);
- switch (dic->di_mode & IFMT) {
- case IFDIR:
+ switch (dic->di_mode & S_IFMT) {
+ case S_IFDIR:
skipd = !dflag;
break;
- case IFREG:
+ case S_IFREG:
if (!rflag && (dic->di_flags & XFS_DIFLAG_REALTIME))
skipd = 1;
else if (!Rflag &&
else
skipd = !fflag;
break;
- case IFLNK:
+ case S_IFLNK:
skipd = !lflag;
break;
default:
typnm_t
inode_next_type(void)
{
- switch (iocur_top->mode & IFMT) {
- case IFDIR:
+ switch (iocur_top->mode & S_IFMT) {
+ case S_IFDIR:
return XFS_DIR_IS_V2(mp) ? TYP_DIR2 : TYP_DIR;
- case IFLNK:
+ case S_IFLNK:
return TYP_SYMLINK;
- case IFREG:
+ case S_IFREG:
if (iocur_top->ino == mp->m_sb.sb_rbmino)
return TYP_RTBITMAP;
else if (iocur_top->ino == mp->m_sb.sb_rsumino)
dip = obj;
ASSERT((char *)&dip->di_u - (char *)dip == byteize(startoff));
return INT_GET(dip->di_core.di_format, ARCH_CONVERT) == XFS_DINODE_FMT_LOCAL &&
- (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & IFMT) == IFREG ?
+ (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & S_IFMT) == S_IFREG ?
(int)INT_GET(dip->di_core.di_size, ARCH_CONVERT) : 0;
}
dip = obj;
ASSERT((char *)&dip->di_u - (char *)dip == byteize(startoff));
return INT_GET(dip->di_core.di_format, ARCH_CONVERT) == XFS_DINODE_FMT_LOCAL &&
- (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & IFMT) == IFDIR
+ (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & S_IFMT) == S_IFDIR
&& XFS_DIR_IS_V1(mp);
}
dip = obj;
ASSERT((char *)&dip->di_u - (char *)dip == byteize(startoff));
return INT_GET(dip->di_core.di_format, ARCH_CONVERT) == XFS_DINODE_FMT_LOCAL &&
- (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & IFMT) == IFDIR &&
+ (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & S_IFMT) == S_IFDIR &&
XFS_DIR_IS_V2(mp);
}
dip = obj;
ASSERT((char *)&dip->di_u - (char *)dip == byteize(startoff));
return INT_GET(dip->di_core.di_format, ARCH_CONVERT) == XFS_DINODE_FMT_LOCAL &&
- (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & IFMT) == IFLNK ?
+ (INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & S_IFMT) == S_IFLNK ?
(int)INT_GET(dip->di_core.di_size, ARCH_CONVERT) : 0;
}
dip = iocur_top->data;
iocur_top->ino = ino;
iocur_top->mode = INT_GET(dip->di_core.di_mode, ARCH_CONVERT);
- if ((iocur_top->mode & IFMT) == IFDIR)
+ if ((iocur_top->mode & S_IFMT) == S_IFDIR)
iocur_top->dirino = ino;
/* track updated info in ring */
xfs_dir_shortform_t di_dirsf; /* shortform directory */
xfs_dir2_sf_t di_dir2sf; /* shortform directory v2 */
char di_c[1]; /* local contents */
- xfs_dev_t di_dev; /* device for IFCHR/IFBLK */
+ xfs_dev_t di_dev; /* device for S_IFCHR/S_IFBLK */
uuid_t di_muuid; /* mount point value */
char di_symlink[1]; /* local symbolic link */
} di_u;
#endif
-/*
- * File types (mode field)
- */
-#define IFMT S_IFMT
-#define IFSOCK S_IFSOCK
-#define IFLNK S_IFLNK
-#define IFREG S_IFREG
-#define IFBLK S_IFBLK
-#define IFDIR S_IFDIR
-#define IFCHR S_IFCHR
-#define IFIFO S_IFIFO
-
-#define ISUID S_ISUID
-#define ISGID S_ISGID
-#define ISVTX S_ISVTX
-#define IREAD S_IRUSR
-#define IWRITE S_IWUSR
-#define IEXEC S_IXUSR
-
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_DINODE)
xfs_dinode_t *xfs_buf_to_dinode(struct xfs_buf *bp);
#define XFS_BUF_TO_DINODE(bp) xfs_buf_to_dinode(bp)
* Inode hashing and hash bucket locking.
*/
#define XFS_BUCKETS(mp) (37*(mp)->m_sb.sb_agcount-1)
-#define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)ino) % (mp)->m_ihsize))
+#define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)(ino)) % (mp)->m_ihsize))
/*
* This is the xfs inode cluster hash. This hash is used by xfs_iflush to
sema_t i_flock; /* inode flush lock */
atomic_t i_pincount; /* inode pin count */
wait_queue_head_t i_ipin_wait; /* inode pinning wait queue */
+ struct xfs_inode **i_refcache; /* ptr to entry in ref cache */
+ struct xfs_inode *i_release; /* inode to unref */
/* I/O state */
xfs_iocore_t i_iocore; /* I/O core */
#define XFS_IUIOSZ 0x0002 /* inode i/o sizes have been explicitly set */
#define XFS_IQUIESCE 0x0004 /* we have started quiescing for this inode */
#define XFS_IRECLAIM 0x0008 /* we have started reclaiming this inode */
-#define XFS_IRECLAIMABLE 0x0010 /* inode can be reclaimed */
+#define XFS_ISTALE 0x0010 /* inode has been staled */
+#define XFS_IRECLAIMABLE 0x0020 /* inode can be reclaimed */
/*
* Flags for inode locking.
#define XFS_CHASH(mp,blk) ((mp)->m_chash + (((uint)blk) % (mp)->m_chsize))
/*
- * For multiple groups support: if ISGID bit is set in the parent
+ * For multiple groups support: if S_ISGID bit is set in the parent
* directory, group of new file is set to that of the parent, and
- * new subdirectory gets ISGID bit from parent.
+ * new subdirectory gets S_ISGID bit from parent.
*/
#define XFS_INHERIT_GID(pip, vfsp) ((pip) != NULL && \
- (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & ISGID)))
+ (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID)))
/*
* xfs_iget.c prototypes.
struct xfs_buf **, boolean_t *, xfs_inode_t **);
void xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, int,
xfs_arch_t);
-int xfs_ifree(struct xfs_trans *, xfs_inode_t *);
+int xfs_ifree(struct xfs_trans *, xfs_inode_t *,
+ struct xfs_bmap_free *);
int xfs_atruncate_start(xfs_inode_t *);
void xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t);
int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *,
ip->i_d.di_dmstate = 0;
ip->i_d.di_flags = 0;
flags = XFS_ILOG_CORE;
- switch (mode & IFMT) {
- case IFIFO:
- case IFCHR:
- case IFBLK:
- case IFSOCK:
+ switch (mode & S_IFMT) {
+ case S_IFIFO:
+ case S_IFCHR:
+ case S_IFBLK:
+ case S_IFSOCK:
ip->i_d.di_format = XFS_DINODE_FMT_DEV;
ip->i_df.if_u2.if_rdev = makedev(major(rdev), minor(rdev)); ip->i_df.if_flags = 0;
flags |= XFS_ILOG_DEV;
break;
- case IFREG:
- case IFDIR:
- case IFLNK:
+ case S_IFREG:
+ case S_IFDIR:
+ case S_IFLNK:
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
ip->i_df.if_flags = XFS_IFEXTENTS;
ip->i_df.if_bytes = ip->i_df.if_real_bytes = 0;
#ifdef DEBUG
ASSERT(ip->i_d.di_magic == XFS_DINODE_MAGIC);
- if ((ip->i_d.di_mode & IFMT) == IFREG) {
+ if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) {
ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) ||
(ip->i_d.di_format == XFS_DINODE_FMT_BTREE) );
}
- else if ((ip->i_d.di_mode & IFMT) == IFDIR) {
+ else if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) {
ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) ||
(ip->i_d.di_format == XFS_DINODE_FMT_BTREE) ||
(ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) );
xfs_da_args_t args;
int count, totallen, newsize, retval;
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if (namelen >= MAXNAMELEN) {
return EINVAL;
}
int rval; /* return value */
int v; /* type-checking value */
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if (namelen >= MAXNAMELEN)
return EINVAL;
* We don't want to deal with the case of keeping inode data inline yet.
* So sending the data fork of a regular inode is invalid.
*/
- ASSERT(!((ip->i_d.di_mode & IFMT) == IFREG &&
+ ASSERT(!((ip->i_d.di_mode & S_IFMT) == S_IFREG &&
whichfork == XFS_DATA_FORK));
ifp = XFS_IFORK_PTR(ip, whichfork);
ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL);
args.dp = dir;
args.trans = trans;
- ASSERT((dir->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dir->i_d.di_mode & S_IFMT) == S_IFDIR);
if ((error = xfs_dir_ino_validate(trans->t_mountp, parent_dir->i_ino)))
return error;
xfs_da_args_t args;
int retval, newsize, done;
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum)))
return (retval);
xfs_da_args_t args;
int count, totallen, newsize, retval;
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
XFS_STATS_INC(xs_dir_remove);
/*
* Fill in the arg structure for this request.
xfs_da_args_t args;
int retval;
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
XFS_STATS_INC(xs_dir_lookup);
/*
xfs_da_args_t args;
int retval;
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum)))
return retval;
memset((char *)&args, 0, sizeof(args));
args.dp = dp;
args.trans = tp;
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if ((error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino))) {
return error;
}
int rval; /* return value */
int v; /* type-checking value */
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) {
return rval;
}
int rval; /* return value */
int v; /* type-checking value */
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
XFS_STATS_INC(xs_dir_lookup);
/*
int rval; /* return value */
int v; /* type-checking value */
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
XFS_STATS_INC(xs_dir_remove);
/*
* Fill in the arg structure for this request.
int rval; /* return value */
int v; /* type-checking value */
- ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
+ ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) {
return rval;
return XFS_ERROR(EFSCORRUPTED);
}
- switch (ip->i_d.di_mode & IFMT) {
- case IFIFO:
- case IFCHR:
- case IFBLK:
- case IFSOCK:
+ switch (ip->i_d.di_mode & S_IFMT) {
+ case S_IFIFO:
+ case S_IFCHR:
+ case S_IFBLK:
+ case S_IFSOCK:
if (unlikely(INT_GET(dip->di_core.di_format, ARCH_CONVERT) != XFS_DINODE_FMT_DEV)) {
XFS_CORRUPTION_ERROR("xfs_iformat(3)", XFS_ERRLEVEL_LOW,
ip->i_mount, dip);
ip->i_df.if_u2.if_rdev = INT_GET(dip->di_u.di_dev, ARCH_CONVERT);
break;
- case IFREG:
- case IFLNK:
- case IFDIR:
+ case S_IFREG:
+ case S_IFLNK:
+ case S_IFDIR:
switch (INT_GET(dip->di_core.di_format, ARCH_CONVERT)) {
case XFS_DINODE_FMT_LOCAL:
/*
* no local regular files yet
*/
- if (unlikely((INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & IFMT) == IFREG)) {
+ if (unlikely((INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & S_IFMT) == S_IFREG)) {
xfs_fs_cmn_err(CE_WARN, ip->i_mount,
"corrupt inode (local format for regular file) %Lu. Unmount and run xfs_repair.",
(unsigned long long) ip->i_ino);
}
bcopy(*ptr, &dino, sizeof(dino));
- mode = dino.di_mode & IFMT;
+ mode = dino.di_mode & S_IFMT;
size = (int)dino.di_size;
xlog_print_trans_inode_core(&dino);
*ptr += sizeof(xfs_dinode_core_t);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
printf("LOCAL inode data\n");
- if (mode == IFDIR) {
+ if (mode == S_IFDIR) {
xlog_print_dir_sf((xfs_dir_shortform_t*)*ptr, size);
}
*ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
printf("LOCAL inode attr\n");
- if (mode == IFDIR) {
+ if (mode == S_IFDIR) {
xlog_print_dir_sf((xfs_dir_shortform_t*)*ptr, size);
}
*ptr += INT_GET(op_head->oh_len, ARCH_CONVERT);
libxfs_trans_ijoin(tp, ip, 0);
libxfs_trans_ihold(tp, ip);
- ip->i_d.di_mode &= ~ISUID;
+ ip->i_d.di_mode &= ~S_ISUID;
/*
* Note that we don't have to worry about mandatory
* file locking being disabled here because we only
- * clear the ISGID bit if the Group execute bit is
+ * clear the S_ISGID bit if the Group execute bit is
* on, but if it was on then mandatory locking wouldn't
* have been enabled.
*/
- if (ip->i_d.di_mode & (IEXEC >> 3))
- ip->i_d.di_mode &= ~ISGID;
+ if (ip->i_d.di_mode & S_IXGRP)
+ ip->i_d.di_mode &= ~S_ISGID;
libxfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
case '-':
break;
case 'u':
- mode |= ISUID;
+ mode |= S_ISUID;
break;
default:
fprintf(stderr, _("%s: bad format string %s\n"),
case '-':
break;
case 'g':
- mode |= ISGID;
+ mode |= S_ISGID;
break;
default:
fprintf(stderr, _("%s: bad format string %s\n"),
case IF_REGULAR:
buf = newregfile(pp, &len);
getres(tp, XFS_B_TO_FSB(mp, len));
- error = libxfs_inode_alloc(&tp, pip, mode|IFREG, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1,
mp->m_dev, &creds, &ip);
if (error)
fail(_("Inode allocation failed"), error);
llen = cvtnum(mp->m_sb.sb_blocksize, mp->m_sb.sb_sectsize, value);
getres(tp, XFS_B_TO_FSB(mp, llen));
- error = libxfs_inode_alloc(&tp, pip, mode|IFREG, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1,
mp->m_dev, &creds, &ip);
if (error)
fail(_("Inode pre-allocation failed"), error);
getres(tp, 0);
majdev = (int)getnum(pp);
mindev = (int)getnum(pp);
- error = libxfs_inode_alloc(&tp, pip, mode|IFBLK, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFBLK, 1,
makedev(majdev, mindev), &creds, &ip);
if (error) {
fail(_("Inode allocation failed"), error);
getres(tp, 0);
majdev = (int)getnum(pp);
mindev = (int)getnum(pp);
- error = libxfs_inode_alloc(&tp, pip, mode|IFCHR, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFCHR, 1,
makedev(majdev, mindev), &creds, &ip);
if (error)
fail(_("Inode allocation failed"), error);
case IF_FIFO:
getres(tp, 0);
- error = libxfs_inode_alloc(&tp, pip, mode|IFIFO, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFIFO, 1,
mp->m_dev, &creds, &ip);
if (error)
fail(_("Inode allocation failed"), error);
buf = getstr(pp);
len = (int)strlen(buf);
getres(tp, XFS_B_TO_FSB(mp, len));
- error = libxfs_inode_alloc(&tp, pip, mode|IFLNK, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFLNK, 1,
mp->m_dev, &creds, &ip);
if (error)
fail(_("Inode allocation failed"), error);
break;
case IF_DIRECTORY:
getres(tp, 0);
- error = libxfs_inode_alloc(&tp, pip, mode|IFDIR, 1,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFDIR, 1,
mp->m_dev, &creds, &ip);
if (error)
fail(_("Inode allocation failed"), error);
if ((i = libxfs_trans_reserve(tp, MKFS_BLOCKRES_INODE, 0, 0, 0, 0)))
res_failed(i);
bzero(&creds, sizeof(creds));
- error = libxfs_inode_alloc(&tp, mp->m_rootip, IFREG, 1,
+ error = libxfs_inode_alloc(&tp, mp->m_rootip, S_IFREG, 1,
mp->m_dev, &creds, &rbmip);
if (error) {
fail(_("Realtime bitmap inode allocation failed"), error);
libxfs_mod_sb(tp, XFS_SB_RBMINO);
libxfs_trans_ihold(tp, rbmip);
mp->m_rbmip = rbmip;
- error = libxfs_inode_alloc(&tp, mp->m_rootip, IFREG, 1,
+ error = libxfs_inode_alloc(&tp, mp->m_rootip, S_IFREG, 1,
mp->m_dev, &creds, &rsumip);
if (error) {
fail(_("Realtime summary inode allocation failed"), error);
* as we reset the inode when we re-use it.
*/
if (INT_GET(dinoc->di_mode, ARCH_CONVERT) != 0 &&
- ((((INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT) >> 12) > 15) ||
+ ((((INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12) > 15) ||
dinoc->di_format < XFS_DINODE_FMT_DEV ||
dinoc->di_format > XFS_DINODE_FMT_UUID ||
- (!(okfmts[(INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT) >> 12] &
+ (!(okfmts[(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12] &
(1 << dinoc->di_format))))) {
/* bad inode format */
retval++;
/* set type and map type info */
- switch (INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT) {
- case IFDIR:
+ switch (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) {
+ case S_IFDIR:
type = XR_INO_DIR;
*isa_dir = 1;
break;
- case IFREG:
+ case S_IFREG:
if (INT_GET(dinoc->di_flags, ARCH_CONVERT) & XFS_DIFLAG_REALTIME)
type = XR_INO_RTDATA;
else if (lino == mp->m_sb.sb_rbmino)
else
type = XR_INO_DATA;
break;
- case IFLNK:
+ case S_IFLNK:
type = XR_INO_SYMLINK;
break;
- case IFCHR:
+ case S_IFCHR:
type = XR_INO_CHRDEV;
break;
- case IFBLK:
+ case S_IFBLK:
type = XR_INO_BLKDEV;
break;
- case IFSOCK:
+ case S_IFSOCK:
type = XR_INO_SOCK;
break;
- case IFIFO:
+ case S_IFIFO:
type = XR_INO_FIFO;
break;
default:
type = XR_INO_UNKNOWN;
do_warn(_("Unexpected inode type %#o inode %llu\n"),
- (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT), lino);
+ (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino);
abort();
break;
}
if (!no_modify) {
do_warn(_("resetting to directory\n"));
INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT,
- &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT));
+ &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT));
INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT,
- |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFDIR);
+ |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFDIR);
} else {
do_warn(_("would reset to directory\n"));
}
} else if (lino == mp->m_sb.sb_uquotino) {
if (type != XR_INO_DATA) {
do_warn(_("user quota inode has bad type 0x%x\n"),
- INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT);
+ INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT);
if (!no_modify) {
*dirty += clear_dinode(mp, dino, lino);
} else if (lino == mp->m_sb.sb_gquotino) {
if (type != XR_INO_DATA) {
do_warn(_("group quota inode has bad type 0x%x\n"),
- INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT);
+ INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT);
if (!no_modify) {
*dirty += clear_dinode(mp, dino, lino);
if (!no_modify) {
do_warn(_("resetting to regular file\n"));
INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT,
- &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT));
+ &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT));
INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT,
- |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFREG);
+ |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFREG);
} else {
do_warn(_("would reset to regular file\n"));
}
bzero(&ip->i_d, sizeof(xfs_dinode_core_t));
ip->i_d.di_magic = XFS_DINODE_MAGIC;
- ip->i_d.di_mode = IFREG;
+ ip->i_d.di_mode = S_IFREG;
ip->i_d.di_version = XFS_DINODE_VERSION_1;
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
bzero(&ip->i_d, sizeof(xfs_dinode_core_t));
ip->i_d.di_magic = XFS_DINODE_MAGIC;
- ip->i_d.di_mode = IFREG;
+ ip->i_d.di_mode = S_IFREG;
ip->i_d.di_version = XFS_DINODE_VERSION_1;
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
bzero(&ip->i_d, sizeof(xfs_dinode_core_t));
ip->i_d.di_magic = XFS_DINODE_MAGIC;
- ip->i_d.di_mode = (__uint16_t) mode|IFDIR;
+ ip->i_d.di_mode = (__uint16_t) mode|S_IFDIR;
ip->i_d.di_version = XFS_DINODE_VERSION_1;
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
do_error(_("%d - couldn't iget root inode to make %s\n"),
i, ORPHANAGE);
- error = libxfs_inode_alloc(&tp, pip, mode|IFDIR,
+ error = libxfs_inode_alloc(&tp, pip, mode|S_IFDIR,
1, mp->m_dev, &zerocr, &ip);
if (error) {