]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - fs/xfs/libxfs/xfs_inode_buf.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[mirror_ubuntu-bionic-kernel.git] / fs / xfs / libxfs / xfs_inode_buf.h
CommitLineData
1fd7115e
DC
1/*
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;
f8d55aa0
DC
23
24/*
93f958f9
DC
25 * In memory representation of the XFS inode. This is held in the in-core struct
26 * xfs_inode and represents the current on disk values but the structure is not
27 * in on-disk format. That is, this structure is always translated to on-disk
f8d55aa0
DC
28 * format specific structures at the appropriate time.
29 */
30struct xfs_icdinode {
f8d55aa0
DC
31 __int8_t di_version; /* inode version */
32 __int8_t di_format; /* format of di_c data */
93f958f9 33 __uint16_t di_flushiter; /* incremented on flush */
f8d55aa0
DC
34 __uint32_t di_uid; /* owner's user id */
35 __uint32_t di_gid; /* owner's group id */
f8d55aa0
DC
36 __uint16_t di_projid_lo; /* lower part of owner's project id */
37 __uint16_t di_projid_hi; /* higher part of owner's project id */
f8d55aa0
DC
38 xfs_fsize_t di_size; /* number of bytes in file */
39 xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */
40 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
41 xfs_extnum_t di_nextents; /* number of extents in data fork */
42 xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/
43 __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
44 __int8_t di_aformat; /* format of attr fork's data */
45 __uint32_t di_dmevmask; /* DMIG event mask */
46 __uint16_t di_dmstate; /* DMIG state info */
47 __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
f8d55aa0 48
f8d55aa0 49 __uint64_t di_flags2; /* more random flags */
f7ca3522 50 __uint32_t di_cowextsize; /* basic cow extent size for file */
f8d55aa0 51
f8d55aa0 52 xfs_ictimestamp_t di_crtime; /* time created */
f8d55aa0 53};
1fd7115e
DC
54
55/*
56 * Inode location information. Stored in the inode and passed to
57 * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
58 */
59struct xfs_imap {
60 xfs_daddr_t im_blkno; /* starting BB of inode chunk */
61 ushort im_len; /* length in BBs of inode chunk */
62 ushort im_boffset; /* inode offset in block in bytes */
63};
64
638f4416
DC
65int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
66 struct xfs_imap *, struct xfs_dinode **,
67 struct xfs_buf **, uint, uint);
68int xfs_iread(struct xfs_mount *, struct xfs_trans *,
69 struct xfs_inode *, uint);
70void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
93f958f9
DC
71void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
72 xfs_lsn_t lsn);
3987848c
DC
73void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from);
74void xfs_log_dinode_to_disk(struct xfs_log_dinode *from,
75 struct xfs_dinode *to);
1fd7115e
DC
76
77#if defined(DEBUG)
638f4416 78void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
1fd7115e
DC
79#else
80#define xfs_inobp_check(mp, bp)
81#endif /* DEBUG */
82
1fd7115e 83#endif /* __XFS_INODE_BUF_H__ */