blob: abba0ae8cf2da2b4012445bc2cc5cbf63b8c9a66 [file] [log] [blame]
Dave Chinner1fd71152013-08-12 20:49:35 +10001/*
2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * 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.
13 *
14 * 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
17 */
18#ifndef __XFS_INODE_BUF_H__
19#define __XFS_INODE_BUF_H__
20
21struct xfs_inode;
22struct xfs_dinode;
23struct xfs_icdinode;
24
25/*
26 * Inode location information. Stored in the inode and passed to
27 * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
28 */
29struct xfs_imap {
30 xfs_daddr_t im_blkno; /* starting BB of inode chunk */
31 ushort im_len; /* length in BBs of inode chunk */
32 ushort im_boffset; /* inode offset in block in bytes */
33};
34
Dave Chinner638f44162013-08-30 10:23:45 +100035int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
36 struct xfs_imap *, struct xfs_dinode **,
37 struct xfs_buf **, uint, uint);
38int xfs_iread(struct xfs_mount *, struct xfs_trans *,
39 struct xfs_inode *, uint);
40void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
41void xfs_dinode_to_disk(struct xfs_dinode *to, struct xfs_icdinode *from);
42void xfs_dinode_from_disk(struct xfs_icdinode *to, struct xfs_dinode *from);
Dave Chinner1fd71152013-08-12 20:49:35 +100043
44#if defined(DEBUG)
Dave Chinner638f44162013-08-30 10:23:45 +100045void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
Dave Chinner1fd71152013-08-12 20:49:35 +100046#else
47#define xfs_inobp_check(mp, bp)
48#endif /* DEBUG */
49
50extern const struct xfs_buf_ops xfs_inode_buf_ops;
Dave Chinnerd8914002013-08-27 11:39:37 +100051extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
Dave Chinner1fd71152013-08-12 20:49:35 +100052
53#endif /* __XFS_INODE_BUF_H__ */