From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: ***** SUSPECTED SPAM ***** [PATCH 08/50] xfs: introduce xfs_rtalloc_defs.h
Date: Mon, 12 Aug 2013 20:49:29 +1000 [thread overview]
Message-ID: <1376304611-22994-9-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1376304611-22994-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
There are quite a few realtime device definitions shared with
userspace. Move them from xfs_rtalloc.h to xfs_rt_alloc_defs.h
so we don't need to share xfs_rtalloc.h with userspace anymore.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/xfs_format.h | 41 ++++++++++++++++++++++++++++++++++++++++
fs/xfs/xfs_rtalloc.c | 2 +-
fs/xfs/xfs_rtalloc.h | 53 ++--------------------------------------------------
fs/xfs/xfs_types.h | 10 ++++++++++
4 files changed, 54 insertions(+), 52 deletions(-)
diff --git a/fs/xfs/xfs_format.h b/fs/xfs/xfs_format.h
index 2b4f166..6205374 100644
--- a/fs/xfs/xfs_format.h
+++ b/fs/xfs/xfs_format.h
@@ -28,6 +28,47 @@
*/
/*
+ * RealTime Device format definitions
+ */
+
+/* Min and max rt extent sizes, specified in bytes */
+#define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */
+#define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */
+#define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */
+
+#define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize)
+#define XFS_BLOCKMASK(mp) ((mp)->m_blockmask)
+#define XFS_BLOCKWSIZE(mp) ((mp)->m_blockwsize)
+#define XFS_BLOCKWMASK(mp) ((mp)->m_blockwmask)
+
+/*
+ * RT Summary and bit manipulation macros.
+ */
+#define XFS_SUMOFFS(mp,ls,bb) ((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb)))
+#define XFS_SUMOFFSTOBLOCK(mp,s) \
+ (((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog)
+#define XFS_SUMPTR(mp,bp,so) \
+ ((xfs_suminfo_t *)((bp)->b_addr + \
+ (((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp))))
+
+#define XFS_BITTOBLOCK(mp,bi) ((bi) >> (mp)->m_blkbit_log)
+#define XFS_BLOCKTOBIT(mp,bb) ((bb) << (mp)->m_blkbit_log)
+#define XFS_BITTOWORD(mp,bi) \
+ ((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp)))
+
+#define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b))
+#define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b))
+
+#define XFS_RTLOBIT(w) xfs_lowbit32(w)
+#define XFS_RTHIBIT(w) xfs_highbit32(w)
+
+#if XFS_BIG_BLKNOS
+#define XFS_RTBLOCKLOG(b) xfs_highbit64(b)
+#else
+#define XFS_RTBLOCKLOG(b) xfs_highbit32(b)
+#endif
+
+/*
* Dquot and dquot block format definitions
*/
#define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 98dc670..5d900ec 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -17,7 +17,7 @@
*/
#include "xfs.h"
#include "xfs_fs.h"
-#include "xfs_types.h"
+#include "xfs_format.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h
index f7f3a35..b2a1a24 100644
--- a/fs/xfs/xfs_rtalloc.h
+++ b/fs/xfs/xfs_rtalloc.h
@@ -18,58 +18,11 @@
#ifndef __XFS_RTALLOC_H__
#define __XFS_RTALLOC_H__
+/* kernel only definitions and functions */
+
struct xfs_mount;
struct xfs_trans;
-/* Min and max rt extent sizes, specified in bytes */
-#define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */
-#define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */
-#define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */
-
-/*
- * Constants for bit manipulations.
- */
-#define XFS_NBBYLOG 3 /* log2(NBBY) */
-#define XFS_WORDLOG 2 /* log2(sizeof(xfs_rtword_t)) */
-#define XFS_NBWORDLOG (XFS_NBBYLOG + XFS_WORDLOG)
-#define XFS_NBWORD (1 << XFS_NBWORDLOG)
-#define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1)
-
-#define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize)
-#define XFS_BLOCKMASK(mp) ((mp)->m_blockmask)
-#define XFS_BLOCKWSIZE(mp) ((mp)->m_blockwsize)
-#define XFS_BLOCKWMASK(mp) ((mp)->m_blockwmask)
-
-/*
- * Summary and bit manipulation macros.
- */
-#define XFS_SUMOFFS(mp,ls,bb) ((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb)))
-#define XFS_SUMOFFSTOBLOCK(mp,s) \
- (((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog)
-#define XFS_SUMPTR(mp,bp,so) \
- ((xfs_suminfo_t *)((bp)->b_addr + \
- (((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp))))
-
-#define XFS_BITTOBLOCK(mp,bi) ((bi) >> (mp)->m_blkbit_log)
-#define XFS_BLOCKTOBIT(mp,bb) ((bb) << (mp)->m_blkbit_log)
-#define XFS_BITTOWORD(mp,bi) \
- ((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp)))
-
-#define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b))
-#define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b))
-
-#define XFS_RTLOBIT(w) xfs_lowbit32(w)
-#define XFS_RTHIBIT(w) xfs_highbit32(w)
-
-#if XFS_BIG_BLKNOS
-#define XFS_RTBLOCKLOG(b) xfs_highbit64(b)
-#else
-#define XFS_RTBLOCKLOG(b) xfs_highbit32(b)
-#endif
-
-
-#ifdef __KERNEL__
-
#ifdef CONFIG_XFS_RT
/*
* Function prototypes for exported functions.
@@ -161,6 +114,4 @@ xfs_rtmount_init(
# define xfs_rtunmount_inodes(m)
#endif /* CONFIG_XFS_RT */
-#endif /* __KERNEL__ */
-
#endif /* __XFS_RTALLOC_H__ */
diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h
index 69074ac..781772c 100644
--- a/fs/xfs/xfs_types.h
+++ b/fs/xfs/xfs_types.h
@@ -183,4 +183,14 @@ struct xfs_name {
*/
typedef __uint32_t xfs_dqid_t;
+/*
+ * Constants for bit manipulations.
+ */
+#define XFS_NBBYLOG 3 /* log2(NBBY) */
+#define XFS_WORDLOG 2 /* log2(sizeof(xfs_rtword_t)) */
+#define XFS_NBWORDLOG (XFS_NBBYLOG + XFS_WORDLOG)
+#define XFS_NBWORD (1 << XFS_NBWORDLOG)
+#define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1)
+
+
#endif /* __XFS_TYPES_H__ */
--
1.8.3.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-08-12 10:50 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 10:49 ***** SUSPECTED SPAM ***** [PATCH 00/50] xfs: patches for 3.12 Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 01/50] xfs: separate out log format definitions Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 02/50] xfs: split out inode log item format definition Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 03/50] xfs: split out buf log item format definitions Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 04/50] xfs: split out EFI/EFD log item format definition Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 05/50] xfs: separate dquot on disk format definitions out of xfs_quota.h Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 06/50] xfs: separate icreate log format definitions from xfs_icreate_item.h Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 07/50] xfs: split out on-disk transaction definitions Dave Chinner
2013-08-12 10:49 ` Dave Chinner [this message]
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 09/50] xfs: introduce xfs_quota_defs.h Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 10/50] xfs: sync minor header differences needed by userspace Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 11/50] xfs: split out transaction reservation code Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 12/50] xfs: move inode fork definitions to a new header file Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 13/50] xfs: move unrelated definitions out of xfs_inode.h Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 14/50] xfs: introduce xfs_inode_buf.c for inode buffer operations Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 15/50] xfs: move getdents code into it's own file Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 16/50] xfs: reshuffle dir2 definitions around for userspace Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 17/50] xfs: split out attribute listing code into separate file Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 18/50] xfs: split out attribute fork truncation " Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 19/50] xfs: split out the remote symlink handling Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 20/50] xfs: introduce xfs_sb.c for sharing with libxfs Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 21/50] xfs: create xfs_bmap_util.[ch] Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 22/50] xfs: minor cleanups Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 23/50] xfs: fix issues that cause userspace warnings Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 24/50] xfs: kill xfs_vnodeops.[ch] Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 25/50] xfs: consolidate xfs_rename.c Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 26/50] xfs: consolidate xfs_utils.c Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 27/50] xfs: consolidate extent swap code Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 28/50] xfs: don't special case shared superblock mounts Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 29/50] xfs: kill __KERNEL__ check for debug code in allocation code Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 30/50] xfs: remove __KERNEL__ from debug code Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 31/50] xfs: remove __KERNEL__ check from xfs_dir2_leaf.c Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 32/50] xfs: xfs_filestreams.h doesn't need __KERNEL__ Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 33/50] xfs: move kernel specific type definitions to xfs.h Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 34/50] xfs: make struct xfs_perag kernel only Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 35/50] xfs: Introduce a new structure to hold transaction reservation items Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 36/50] xfs: Introduce tr_fsyncts to m_reservation Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 37/50] xfs: Make writeid transaction use tr_writeid Dave Chinner
2013-08-12 10:49 ` ***** SUSPECTED SPAM ***** [PATCH 38/50] xfs: refactor xfs_trans_reserve() interface Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 39/50] xfs: Get rid of all XFS_XXX_LOG_RES() macro Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 40/50] xfs: Refactor xfs_ticket_alloc() to extract a new helper Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 41/50] xfs: Add xfs_log_rlimit.c Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 42/50] xfs: Validate log space at mount time Dave Chinner
2013-08-12 18:46 ` Mark Tinguely
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 43/50] xfs: return log item size in IOP_SIZE Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 44/50] xfs: Reduce allocations during CIL insertion Dave Chinner
2013-08-13 13:28 ` Mark Tinguely
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 45/50] xfs: avoid CIL allocation during insert Dave Chinner
2013-08-13 13:37 ` Mark Tinguely
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 46/50] xfs: Combine CIL insert and prepare passes Dave Chinner
2013-08-13 14:02 ` Mark Tinguely
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 47/50] xfs: split the CIL lock Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 48/50] xfs: Add read-only support for dirent filetype field Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 49/50] xfs: Add write " Dave Chinner
2013-08-12 10:50 ` ***** SUSPECTED SPAM ***** [PATCH 50/50] xfs: use reference counts to free clean buffer items Dave Chinner
2013-08-13 15:03 ` Mark Tinguely
2013-08-13 21:46 ` Dave Chinner
2013-08-13 22:00 ` Mark Tinguely
2013-08-14 3:57 ` Dave Chinner
2013-08-14 4:12 ` Zhi Yong Wu
2013-08-14 6:41 ` Dave Chinner
2013-08-14 13:26 ` Mark Tinguely
2013-08-14 17:49 ` Mark Tinguely
2013-08-15 0:48 ` Dave Chinner
2013-08-15 21:43 ` ***** SUSPECTED SPAM ***** " Ben Myers
2013-08-12 22:55 ` ***** SUSPECTED SPAM ***** [PATCH 00/50] xfs: patches for 3.12 Ben Myers
2013-08-13 21:28 ` Ben Myers
2013-08-19 20:19 ` [PATCH 51/50] xfs: add xfs sb v4 support for dirent filetype field Mark Tinguely
2013-08-19 23:28 ` Eric Sandeen
2013-08-20 14:29 ` Mark Tinguely
2013-08-20 14:45 ` Eric Sandeen
2013-08-20 18:50 ` Ben Myers
2013-08-20 21:00 ` Mark Tinguely
2013-08-20 21:05 ` Ben Myers
2013-08-20 23:19 ` Dave Chinner
2013-08-21 0:06 ` Dave Chinner
2013-08-21 17:03 ` Ben Myers
2013-08-22 2:02 ` Dave Chinner
2013-08-22 16:14 ` Geoffrey Wehrman
2013-08-22 18:19 ` Ben Myers
2013-08-25 5:18 ` Michael L. Semon
2013-08-25 23:21 ` Michael L. Semon
2013-08-26 15:40 ` Mark Tinguely
2013-08-19 23:40 ` Dave Chinner
2013-08-20 19:57 ` Geoffrey Wehrman
2013-08-22 15:59 ` ***** SUSPECTED SPAM ***** [PATCH 00/50] xfs: patches for 3.12 Ben Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376304611-22994-9-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.