patch-2.4.27 linux-2.4.27/fs/xfs/xfs_inode.c
Next file: linux-2.4.27/fs/xfs/xfs_inode.h
Previous file: linux-2.4.27/fs/xfs/xfs_fsops.c
Back to the patch index
Back to the overall index
- Lines: 91
- Date:
2004-08-07 16:26:06.127407303 -0700
- Orig file:
linux-2.4.26/fs/xfs/xfs_inode.c
- Orig date:
2004-04-14 06:05:40.000000000 -0700
diff -urN linux-2.4.26/fs/xfs/xfs_inode.c linux-2.4.27/fs/xfs/xfs_inode.c
@@ -854,6 +854,34 @@
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 = 0;
+
+ di_flags = INT_GET(dic->di_flags, arch);
+ 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 (XFS_CFORK_Q_ARCH(dic, arch))
+ flags |= XFS_XFLAG_HASATTR;
+ return flags;
+}
+
/*
* Given a mount structure and an inode number, return a pointer
* to a newly allocated in-core inode coresponding to the given
@@ -1112,8 +1140,7 @@
* 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;
@@ -3668,12 +3695,6 @@
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;
@@ -3725,32 +3746,6 @@
}
/*
- * 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
*/
uint
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)