INT_XLATE(buf_core->di_gen, mem_core->di_gen, dir, arch);
}
+uint
+xfs_dic2xflags(
+ xfs_dinode_core_t *dic,
+ xfs_arch_t arch)
+{
+ __uint16_t di_flags;
+ uint flags;
+
+ di_flags = INT_GET(dic->di_flags, arch);
+ flags = XFS_CFORK_Q_ARCH(dic, arch) ? XFS_XFLAG_HASATTR : 0;
+ if (di_flags & XFS_DIFLAG_ANY) {
+ if (di_flags & XFS_DIFLAG_REALTIME)
+ flags |= XFS_XFLAG_REALTIME;
+ if (di_flags & XFS_DIFLAG_PREALLOC)
+ flags |= XFS_XFLAG_PREALLOC;
+ if (di_flags & XFS_DIFLAG_IMMUTABLE)
+ flags |= XFS_XFLAG_IMMUTABLE;
+ if (di_flags & XFS_DIFLAG_APPEND)
+ flags |= XFS_XFLAG_APPEND;
+ if (di_flags & XFS_DIFLAG_SYNC)
+ flags |= XFS_XFLAG_SYNC;
+ if (di_flags & XFS_DIFLAG_NOATIME)
+ flags |= XFS_XFLAG_NOATIME;
+ if (di_flags & XFS_DIFLAG_NODUMP)
+ flags |= XFS_XFLAG_NODUMP;
+ if (di_flags & XFS_DIFLAG_RTINHERIT)
+ flags |= XFS_XFLAG_RTINHERIT;
+ if (di_flags & XFS_DIFLAG_PROJINHERIT)
+ flags |= XFS_XFLAG_PROJINHERIT;
+ if (di_flags & XFS_DIFLAG_NOSYMLINKS)
+ flags |= XFS_XFLAG_NOSYMLINKS;
+ }
+ return flags;
+}
+
/*
* Given a mount structure and an inode number, return a pointer
* to a newly allocated in-core inode coresponding to the given
* Call the space management code to pick
* the on-disk inode to be allocated.
*/
- ASSERT(pip != NULL);
- error = xfs_dialloc(tp, pip ? pip->i_ino : 0, mode, okalloc,
+ error = xfs_dialloc(tp, pip->i_ino, mode, okalloc,
ialloc_context, call_again, &ino);
if (error != 0) {
return error;
break;
case S_IFREG:
case S_IFDIR:
- if (pip->i_d.di_flags &
- (XFS_DIFLAG_NOATIME|XFS_DIFLAG_NODUMP|XFS_DIFLAG_SYNC)) {
+ if (unlikely(pip->i_d.di_flags & XFS_DIFLAG_ANY)) {
+ if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) {
+ if ((mode & S_IFMT) == S_IFDIR) {
+ ip->i_d.di_flags |= XFS_DIFLAG_RTINHERIT;
+ } else {
+ ip->i_d.di_flags |= XFS_DIFLAG_REALTIME;
+ ip->i_iocore.io_flags |= XFS_IOCORE_RT;
+ }
+ }
if ((pip->i_d.di_flags & XFS_DIFLAG_NOATIME) &&
xfs_inherit_noatime)
ip->i_d.di_flags |= XFS_DIFLAG_NOATIME;
if ((pip->i_d.di_flags & XFS_DIFLAG_SYNC) &&
xfs_inherit_sync)
ip->i_d.di_flags |= XFS_DIFLAG_SYNC;
+ if ((pip->i_d.di_flags & XFS_DIFLAG_NOSYMLINKS) &&
+ xfs_inherit_nosymlinks)
+ ip->i_d.di_flags |= XFS_DIFLAG_NOSYMLINKS;
}
+ /* FALLTHROUGH */
case S_IFLNK:
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
ip->i_df.if_flags = XFS_IFEXTENTS;
return XFS_ERROR(EFSCORRUPTED);
}
+
/*
* Flush all inactive inodes in mp. Return true if no user references
* were found, false otherwise.
continue;
}
if (!(flag & XFS_FLUSH_ALL)) {
- ASSERT(0);
busy = 1;
done = 1;
break;
mode_t orgmode = mode;
struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip));
- /*
- * Verify that the MAC policy allows the requested access.
- */
- if ((error = _MAC_XFS_IACCESS(ip, mode, cr)))
- return XFS_ERROR(error);
-
if (mode & S_IWUSR) {
umode_t imode = inode->i_mode;
return XFS_ERROR(EACCES);
}
-/*
- * Return whether or not it is OK to swap to the given file in the
- * given range. Return 0 for OK and otherwise return the error.
- *
- * It is only OK to swap to a file if it has no holes, and all
- * extents have been initialized.
- *
- * We use the vnode behavior chain prevent and allow primitives
- * to ensure that the vnode chain stays coherent while we do this.
- * This allows us to walk the chain down to the bottom where XFS
- * lives without worrying about it changing out from under us.
- */
-int
-xfs_swappable(
- bhv_desc_t *bdp)
-{
- xfs_inode_t *ip;
-
- ip = XFS_BHVTOI(bdp);
- /*
- * Verify that the file does not have any
- * holes or unwritten exents.
- */
- return xfs_bmap_check_swappable(ip);
-}
-
/*
* xfs_iroundup: round up argument to next power of two
*/
(void *)ra, /* caller of ilock */
(void *)(unsigned long)current_cpu(),
(void *)(unsigned long)current_pid(),
- 0,0,0,0,0,0,0,0,0,0);
+ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
}
#endif