2 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
34 #include "xfs_macros.h"
35 #include "xfs_types.h"
38 #include "xfs_trans.h"
43 #include "xfs_dmapi.h"
44 #include "xfs_mount.h"
45 #include "xfs_alloc_btree.h"
46 #include "xfs_bmap_btree.h"
47 #include "xfs_ialloc_btree.h"
48 #include "xfs_itable.h"
49 #include "xfs_btree.h"
50 #include "xfs_alloc.h"
51 #include "xfs_ialloc.h"
52 #include "xfs_attr_sf.h"
53 #include "xfs_dir_sf.h"
54 #include "xfs_dir2_sf.h"
55 #include "xfs_dinode.h"
56 #include "xfs_inode_item.h"
57 #include "xfs_inode.h"
59 #include "xfs_error.h"
62 #include "xfs_quota.h"
63 #include "xfs_trans_space.h"
64 #include "xfs_iomap.h"
71 return (ip->i_d.di_size);
77 struct xfs_mount_args *mntargs,
80 return xfs_mountfs(vfsp, XFS_VFSTOM(vfsp), flags);
83 xfs_ioops_t xfs_iocore_xfs = {
84 .xfs_ioinit = (xfs_ioinit_t) xfs_ioinit,
85 .xfs_bmapi_func = (xfs_bmapi_t) xfs_bmapi,
86 .xfs_bmap_eof_func = (xfs_bmap_eof_t) xfs_bmap_eof,
87 .xfs_iomap_write_direct =
88 (xfs_iomap_write_direct_t) xfs_iomap_write_direct,
89 .xfs_iomap_write_delay =
90 (xfs_iomap_write_delay_t) xfs_iomap_write_delay,
91 .xfs_iomap_write_allocate =
92 (xfs_iomap_write_allocate_t) xfs_iomap_write_allocate,
93 .xfs_iomap_write_unwritten =
94 (xfs_iomap_write_unwritten_t) xfs_iomap_write_unwritten,
95 .xfs_ilock = (xfs_lock_t) xfs_ilock,
96 .xfs_lck_map_shared = (xfs_lck_map_shared_t) xfs_ilock_map_shared,
97 .xfs_ilock_demote = (xfs_lock_demote_t) xfs_ilock_demote,
98 .xfs_ilock_nowait = (xfs_lock_nowait_t) xfs_ilock_nowait,
99 .xfs_unlock = (xfs_unlk_t) xfs_iunlock,
100 .xfs_size_func = (xfs_size_t) xfs_size_fn,
101 .xfs_iodone = (xfs_iodone_t) fs_noerr,
105 xfs_iocore_inode_reinit(
108 xfs_iocore_t *io = &ip->i_iocore;
111 if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
112 io->io_flags |= XFS_IOCORE_RT;
113 io->io_dmevmask = ip->i_d.di_dmevmask;
114 io->io_dmstate = ip->i_d.di_dmstate;
118 xfs_iocore_inode_init(
121 xfs_iocore_t *io = &ip->i_iocore;
122 xfs_mount_t *mp = ip->i_mount;
126 io->io_lock = &ip->i_lock;
127 io->io_iolock = &ip->i_iolock;
130 io->io_obj = (void *)ip;
132 xfs_iocore_inode_reinit(ip);