aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-27 22:27:10 -0500
committerDave Chinner <david@fromorbit.com>2014-11-27 22:27:10 -0500
commit508b6b3b73888e3296ff638b32f15327e63b7b42 (patch)
tree6ffb0eb96e055e9197e1b77f27f1f02af313e3eb /fs
parentbb58e6188a10f06dc65612a59ce3815da62ca3c1 (diff)
xfs: merge xfs_inum.h into xfs_format.h
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c1
-rw-r--r--fs/xfs/libxfs/xfs_dir2.c1
-rw-r--r--fs/xfs/libxfs/xfs_format.h35
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c1
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.c1
-rw-r--r--fs/xfs/libxfs/xfs_inum.h60
-rw-r--r--fs/xfs/xfs_filestream.c1
-rw-r--r--fs/xfs/xfs_icache.c1
-rw-r--r--fs/xfs/xfs_inode.c1
-rw-r--r--fs/xfs/xfs_itable.c1
-rw-r--r--fs/xfs/xfs_log_recover.c1
-rw-r--r--fs/xfs/xfs_mount.c1
-rw-r--r--fs/xfs/xfs_super.c1
13 files changed, 35 insertions, 71 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 68d91338fcc4..c2a36c331b9c 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -22,7 +22,6 @@
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_bit.h" 24#include "xfs_bit.h"
25#include "xfs_inum.h"
26#include "xfs_sb.h" 25#include "xfs_sb.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_da_format.h" 27#include "xfs_da_format.h"
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c
index 5d892911158b..d399f174a809 100644
--- a/fs/xfs/libxfs/xfs_dir2.c
+++ b/fs/xfs/libxfs/xfs_dir2.c
@@ -20,7 +20,6 @@
20#include "xfs_format.h" 20#include "xfs_format.h"
21#include "xfs_log_format.h" 21#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
23#include "xfs_inum.h"
24#include "xfs_mount.h" 23#include "xfs_mount.h"
25#include "xfs_da_format.h" 24#include "xfs_da_format.h"
26#include "xfs_da_btree.h" 25#include "xfs_da_btree.h"
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index 70ca740f34ac..fbd6da263571 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -1068,6 +1068,41 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
1068 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \ 1068 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
1069 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM) 1069 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
1070 1070
1071/*
1072 * Inode number format:
1073 * low inopblog bits - offset in block
1074 * next agblklog bits - block number in ag
1075 * next agno_log bits - ag number
1076 * high agno_log-agblklog-inopblog bits - 0
1077 */
1078#define XFS_INO_MASK(k) (__uint32_t)((1ULL << (k)) - 1)
1079#define XFS_INO_OFFSET_BITS(mp) (mp)->m_sb.sb_inopblog
1080#define XFS_INO_AGBNO_BITS(mp) (mp)->m_sb.sb_agblklog
1081#define XFS_INO_AGINO_BITS(mp) (mp)->m_agino_log
1082#define XFS_INO_AGNO_BITS(mp) (mp)->m_agno_log
1083#define XFS_INO_BITS(mp) \
1084 XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp)
1085#define XFS_INO_TO_AGNO(mp,i) \
1086 ((xfs_agnumber_t)((i) >> XFS_INO_AGINO_BITS(mp)))
1087#define XFS_INO_TO_AGINO(mp,i) \
1088 ((xfs_agino_t)(i) & XFS_INO_MASK(XFS_INO_AGINO_BITS(mp)))
1089#define XFS_INO_TO_AGBNO(mp,i) \
1090 (((xfs_agblock_t)(i) >> XFS_INO_OFFSET_BITS(mp)) & \
1091 XFS_INO_MASK(XFS_INO_AGBNO_BITS(mp)))
1092#define XFS_INO_TO_OFFSET(mp,i) \
1093 ((int)(i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
1094#define XFS_INO_TO_FSB(mp,i) \
1095 XFS_AGB_TO_FSB(mp, XFS_INO_TO_AGNO(mp,i), XFS_INO_TO_AGBNO(mp,i))
1096#define XFS_AGINO_TO_INO(mp,a,i) \
1097 (((xfs_ino_t)(a) << XFS_INO_AGINO_BITS(mp)) | (i))
1098#define XFS_AGINO_TO_AGBNO(mp,i) ((i) >> XFS_INO_OFFSET_BITS(mp))
1099#define XFS_AGINO_TO_OFFSET(mp,i) \
1100 ((i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
1101#define XFS_OFFBNO_TO_AGINO(mp,b,o) \
1102 ((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o)))
1103
1104#define XFS_MAXINUMBER ((xfs_ino_t)((1ULL << 56) - 1ULL))
1105#define XFS_MAXINUMBER_32 ((xfs_ino_t)((1ULL << 32) - 1ULL))
1071 1106
1072/* 1107/*
1073 * RealTime Device format definitions 1108 * RealTime Device format definitions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 1dae7dae6a3c..92d2617e61fa 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -22,7 +22,6 @@
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_bit.h" 24#include "xfs_bit.h"
25#include "xfs_inum.h"
26#include "xfs_sb.h" 25#include "xfs_sb.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_inode.h" 27#include "xfs_inode.h"
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index 8912d28eb43e..0defbd02f62d 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -22,7 +22,6 @@
22#include "xfs_format.h" 22#include "xfs_format.h"
23#include "xfs_log_format.h" 23#include "xfs_log_format.h"
24#include "xfs_trans_resv.h" 24#include "xfs_trans_resv.h"
25#include "xfs_inum.h"
26#include "xfs_mount.h" 25#include "xfs_mount.h"
27#include "xfs_inode.h" 26#include "xfs_inode.h"
28#include "xfs_trans.h" 27#include "xfs_trans.h"
diff --git a/fs/xfs/libxfs/xfs_inum.h b/fs/xfs/libxfs/xfs_inum.h
deleted file mode 100644
index 4ff2278e147a..000000000000
--- a/fs/xfs/libxfs/xfs_inum.h
+++ /dev/null
@@ -1,60 +0,0 @@
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_INUM_H__
19#define __XFS_INUM_H__
20
21/*
22 * Inode number format:
23 * low inopblog bits - offset in block
24 * next agblklog bits - block number in ag
25 * next agno_log bits - ag number
26 * high agno_log-agblklog-inopblog bits - 0
27 */
28
29struct xfs_mount;
30
31#define XFS_INO_MASK(k) (__uint32_t)((1ULL << (k)) - 1)
32#define XFS_INO_OFFSET_BITS(mp) (mp)->m_sb.sb_inopblog
33#define XFS_INO_AGBNO_BITS(mp) (mp)->m_sb.sb_agblklog
34#define XFS_INO_AGINO_BITS(mp) (mp)->m_agino_log
35#define XFS_INO_AGNO_BITS(mp) (mp)->m_agno_log
36#define XFS_INO_BITS(mp) \
37 XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp)
38#define XFS_INO_TO_AGNO(mp,i) \
39 ((xfs_agnumber_t)((i) >> XFS_INO_AGINO_BITS(mp)))
40#define XFS_INO_TO_AGINO(mp,i) \
41 ((xfs_agino_t)(i) & XFS_INO_MASK(XFS_INO_AGINO_BITS(mp)))
42#define XFS_INO_TO_AGBNO(mp,i) \
43 (((xfs_agblock_t)(i) >> XFS_INO_OFFSET_BITS(mp)) & \
44 XFS_INO_MASK(XFS_INO_AGBNO_BITS(mp)))
45#define XFS_INO_TO_OFFSET(mp,i) \
46 ((int)(i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
47#define XFS_INO_TO_FSB(mp,i) \
48 XFS_AGB_TO_FSB(mp, XFS_INO_TO_AGNO(mp,i), XFS_INO_TO_AGBNO(mp,i))
49#define XFS_AGINO_TO_INO(mp,a,i) \
50 (((xfs_ino_t)(a) << XFS_INO_AGINO_BITS(mp)) | (i))
51#define XFS_AGINO_TO_AGBNO(mp,i) ((i) >> XFS_INO_OFFSET_BITS(mp))
52#define XFS_AGINO_TO_OFFSET(mp,i) \
53 ((i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
54#define XFS_OFFBNO_TO_AGINO(mp,b,o) \
55 ((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o)))
56
57#define XFS_MAXINUMBER ((xfs_ino_t)((1ULL << 56) - 1ULL))
58#define XFS_MAXINUMBER_32 ((xfs_ino_t)((1ULL << 32) - 1ULL))
59
60#endif /* __XFS_INUM_H__ */
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c
index c5b06a925035..a2e86e8a0fea 100644
--- a/fs/xfs/xfs_filestream.c
+++ b/fs/xfs/xfs_filestream.c
@@ -22,7 +22,6 @@
22#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 23#include "xfs_sb.h"
24#include "xfs_mount.h" 24#include "xfs_mount.h"
25#include "xfs_inum.h"
26#include "xfs_inode.h" 25#include "xfs_inode.h"
27#include "xfs_bmap.h" 26#include "xfs_bmap.h"
28#include "xfs_bmap_util.h" 27#include "xfs_bmap_util.h"
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index e364723bd160..92ca910d0ec6 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -20,7 +20,6 @@
20#include "xfs_format.h" 20#include "xfs_format.h"
21#include "xfs_log_format.h" 21#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
23#include "xfs_inum.h"
24#include "xfs_sb.h" 23#include "xfs_sb.h"
25#include "xfs_mount.h" 24#include "xfs_mount.h"
26#include "xfs_inode.h" 25#include "xfs_inode.h"
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 229dfdefdb85..7054bae57a8f 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -23,7 +23,6 @@
23#include "xfs_format.h" 23#include "xfs_format.h"
24#include "xfs_log_format.h" 24#include "xfs_log_format.h"
25#include "xfs_trans_resv.h" 25#include "xfs_trans_resv.h"
26#include "xfs_inum.h"
27#include "xfs_sb.h" 26#include "xfs_sb.h"
28#include "xfs_mount.h" 27#include "xfs_mount.h"
29#include "xfs_inode.h" 28#include "xfs_inode.h"
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 584feee3edb7..17cf16183136 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -21,7 +21,6 @@
21#include "xfs_format.h" 21#include "xfs_format.h"
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_inum.h"
25#include "xfs_mount.h" 24#include "xfs_mount.h"
26#include "xfs_inode.h" 25#include "xfs_inode.h"
27#include "xfs_btree.h" 26#include "xfs_btree.h"
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 697073acc3e5..75705dd047b5 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -22,7 +22,6 @@
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_bit.h" 24#include "xfs_bit.h"
25#include "xfs_inum.h"
26#include "xfs_sb.h" 25#include "xfs_sb.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_da_format.h" 27#include "xfs_da_format.h"
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index e627336265c8..92faae5db406 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -22,7 +22,6 @@
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_bit.h" 24#include "xfs_bit.h"
25#include "xfs_inum.h"
26#include "xfs_sb.h" 25#include "xfs_sb.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_da_format.h" 27#include "xfs_da_format.h"
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index af4f63efa2a8..f14affca296b 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -21,7 +21,6 @@
21#include "xfs_format.h" 21#include "xfs_format.h"
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_inum.h"
25#include "xfs_sb.h" 24#include "xfs_sb.h"
26#include "xfs_mount.h" 25#include "xfs_mount.h"
27#include "xfs_da_format.h" 26#include "xfs_da_format.h"