blob: 336e27b39e130ec65db56dda6b2a5566e0cc7766 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Nathan Scott7b718762005-11-02 14:58:39 +11002 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
Nathan Scott7b718762005-11-02 14:58:39 +11005 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * published by the Free Software Foundation.
8 *
Nathan Scott7b718762005-11-02 14:58:39 +11009 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
Nathan Scott7b718762005-11-02 14:58:39 +110014 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include "xfs.h"
Nathan Scotta844f452005-11-02 14:38:42 +110019#include "xfs_fs.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include "xfs_types.h"
Nathan Scotta844f452005-11-02 14:38:42 +110021#include "xfs_bit.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include "xfs_log.h"
Nathan Scotta844f452005-11-02 14:38:42 +110023#include "xfs_inum.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#include "xfs_trans.h"
25#include "xfs_sb.h"
26#include "xfs_ag.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#include "xfs_dir2.h"
Olaf Weber3e57ecf2006-06-09 14:48:12 +100028#include "xfs_dfrag.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#include "xfs_dmapi.h"
30#include "xfs_mount.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include "xfs_bmap_btree.h"
Nathan Scotta844f452005-11-02 14:38:42 +110032#include "xfs_alloc_btree.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#include "xfs_ialloc_btree.h"
Nathan Scotta844f452005-11-02 14:38:42 +110034#include "xfs_dir2_sf.h"
35#include "xfs_attr_sf.h"
36#include "xfs_dinode.h"
37#include "xfs_inode.h"
38#include "xfs_inode_item.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070039#include "xfs_itable.h"
40#include "xfs_btree.h"
41#include "xfs_alloc.h"
42#include "xfs_ialloc.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#include "xfs_bmap.h"
44#include "xfs_error.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#include "xfs_rw.h"
46#include "xfs_quota.h"
47#include "xfs_trans_space.h"
48#include "xfs_iomap.h"
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050void
51xfs_iocore_inode_reinit(
52 xfs_inode_t *ip)
53{
54 xfs_iocore_t *io = &ip->i_iocore;
55
56 io->io_flags = 0;
57 if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
58 io->io_flags |= XFS_IOCORE_RT;
59 io->io_dmevmask = ip->i_d.di_dmevmask;
60 io->io_dmstate = ip->i_d.di_dmstate;
61}
62
63void
64xfs_iocore_inode_init(
65 xfs_inode_t *ip)
66{
67 xfs_iocore_t *io = &ip->i_iocore;
68 xfs_mount_t *mp = ip->i_mount;
69
70 io->io_mount = mp;
71#ifdef DEBUG
72 io->io_lock = &ip->i_lock;
73 io->io_iolock = &ip->i_iolock;
74#endif
75
76 io->io_obj = (void *)ip;
77
78 xfs_iocore_inode_reinit(ip);
79}