aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-12 06:49:55 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 18:44:36 -0400
commit9356fe22af084e7b9c1f3c8633a1cbe9b36de405 (patch)
tree9565b714f4babcac4ca914418b61788d6b588eed /fs/xfs
parent4f3d71f68bc976321b19efe2624cd91619af601f (diff)
xfs: make struct xfs_perag kernel only
The struct xfs_perag has many kernel-only definitions in it, requiring a __KERNEL__ guard so userspace can use it to. Move it to xfs_mount.h so that it it kernel-only, and let userspace redefine it's own version of the structure containing only what it needs. This gets rid of another __KERNEL__ check in the XFS header files. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_acl.c1
-rw-r--r--fs/xfs/xfs_ag.h53
-rw-r--r--fs/xfs/xfs_mount.h52
-rw-r--r--fs/xfs/xfs_symlink_remote.c1
4 files changed, 54 insertions, 53 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 0c4368aac449..2f77db865ad9 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -22,6 +22,7 @@
22#include "xfs_attr.h" 22#include "xfs_attr.h"
23#include "xfs_bmap_btree.h" 23#include "xfs_bmap_btree.h"
24#include "xfs_inode.h" 24#include "xfs_inode.h"
25#include "xfs_ag.h"
25#include "xfs_sb.h" 26#include "xfs_sb.h"
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_trace.h" 28#include "xfs_trace.h"
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h
index 317aa86d96ea..1cb740afd674 100644
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -227,59 +227,6 @@ typedef struct xfs_agfl {
227} xfs_agfl_t; 227} xfs_agfl_t;
228 228
229/* 229/*
230 * Per-ag incore structure, copies of information in agf and agi,
231 * to improve the performance of allocation group selection.
232 */
233#define XFS_PAGB_NUM_SLOTS 128
234
235typedef struct xfs_perag {
236 struct xfs_mount *pag_mount; /* owner filesystem */
237 xfs_agnumber_t pag_agno; /* AG this structure belongs to */
238 atomic_t pag_ref; /* perag reference count */
239 char pagf_init; /* this agf's entry is initialized */
240 char pagi_init; /* this agi's entry is initialized */
241 char pagf_metadata; /* the agf is preferred to be metadata */
242 char pagi_inodeok; /* The agi is ok for inodes */
243 __uint8_t pagf_levels[XFS_BTNUM_AGF];
244 /* # of levels in bno & cnt btree */
245 __uint32_t pagf_flcount; /* count of blocks in freelist */
246 xfs_extlen_t pagf_freeblks; /* total free blocks */
247 xfs_extlen_t pagf_longest; /* longest free space */
248 __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */
249 xfs_agino_t pagi_freecount; /* number of free inodes */
250 xfs_agino_t pagi_count; /* number of allocated inodes */
251
252 /*
253 * Inode allocation search lookup optimisation.
254 * If the pagino matches, the search for new inodes
255 * doesn't need to search the near ones again straight away
256 */
257 xfs_agino_t pagl_pagino;
258 xfs_agino_t pagl_leftrec;
259 xfs_agino_t pagl_rightrec;
260#ifdef __KERNEL__
261 spinlock_t pagb_lock; /* lock for pagb_tree */
262 struct rb_root pagb_tree; /* ordered tree of busy extents */
263
264 atomic_t pagf_fstrms; /* # of filestreams active in this AG */
265
266 spinlock_t pag_ici_lock; /* incore inode cache lock */
267 struct radix_tree_root pag_ici_root; /* incore inode cache root */
268 int pag_ici_reclaimable; /* reclaimable inodes */
269 struct mutex pag_ici_reclaim_lock; /* serialisation point */
270 unsigned long pag_ici_reclaim_cursor; /* reclaim restart point */
271
272 /* buffer cache index */
273 spinlock_t pag_buf_lock; /* lock for pag_buf_tree */
274 struct rb_root pag_buf_tree; /* ordered tree of active buffers */
275
276 /* for rcu-safe freeing */
277 struct rcu_head rcu_head;
278#endif
279 int pagb_count; /* pagb slots in use */
280} xfs_perag_t;
281
282/*
283 * tags for inode radix tree 230 * tags for inode radix tree
284 */ 231 */
285#define XFS_ICI_NO_TAG (-1) /* special flag for an untagged lookup 232#define XFS_ICI_NO_TAG (-1) /* special flag for an untagged lookup
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 5488df18c200..829035f615aa 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -320,6 +320,58 @@ typedef struct xfs_mod_sb {
320 int64_t msb_delta; /* Change to make to specified field */ 320 int64_t msb_delta; /* Change to make to specified field */
321} xfs_mod_sb_t; 321} xfs_mod_sb_t;
322 322
323/*
324 * Per-ag incore structure, copies of information in agf and agi, to improve the
325 * performance of allocation group selection. This is defined for the kernel
326 * only, and hence is defined here instead of in xfs_ag.h. You need the struct
327 * xfs_mount to be defined to look up a xfs_perag anyway (via mp->m_perag_tree),
328 * so this doesn't introduce any strange header file dependencies.
329 */
330typedef struct xfs_perag {
331 struct xfs_mount *pag_mount; /* owner filesystem */
332 xfs_agnumber_t pag_agno; /* AG this structure belongs to */
333 atomic_t pag_ref; /* perag reference count */
334 char pagf_init; /* this agf's entry is initialized */
335 char pagi_init; /* this agi's entry is initialized */
336 char pagf_metadata; /* the agf is preferred to be metadata */
337 char pagi_inodeok; /* The agi is ok for inodes */
338 __uint8_t pagf_levels[XFS_BTNUM_AGF];
339 /* # of levels in bno & cnt btree */
340 __uint32_t pagf_flcount; /* count of blocks in freelist */
341 xfs_extlen_t pagf_freeblks; /* total free blocks */
342 xfs_extlen_t pagf_longest; /* longest free space */
343 __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */
344 xfs_agino_t pagi_freecount; /* number of free inodes */
345 xfs_agino_t pagi_count; /* number of allocated inodes */
346
347 /*
348 * Inode allocation search lookup optimisation.
349 * If the pagino matches, the search for new inodes
350 * doesn't need to search the near ones again straight away
351 */
352 xfs_agino_t pagl_pagino;
353 xfs_agino_t pagl_leftrec;
354 xfs_agino_t pagl_rightrec;
355 spinlock_t pagb_lock; /* lock for pagb_tree */
356 struct rb_root pagb_tree; /* ordered tree of busy extents */
357
358 atomic_t pagf_fstrms; /* # of filestreams active in this AG */
359
360 spinlock_t pag_ici_lock; /* incore inode cache lock */
361 struct radix_tree_root pag_ici_root; /* incore inode cache root */
362 int pag_ici_reclaimable; /* reclaimable inodes */
363 struct mutex pag_ici_reclaim_lock; /* serialisation point */
364 unsigned long pag_ici_reclaim_cursor; /* reclaim restart point */
365
366 /* buffer cache index */
367 spinlock_t pag_buf_lock; /* lock for pag_buf_tree */
368 struct rb_root pag_buf_tree; /* ordered tree of active buffers */
369
370 /* for rcu-safe freeing */
371 struct rcu_head rcu_head;
372 int pagb_count; /* pagb slots in use */
373} xfs_perag_t;
374
323extern int xfs_log_sbcount(xfs_mount_t *); 375extern int xfs_log_sbcount(xfs_mount_t *);
324extern __uint64_t xfs_default_resblks(xfs_mount_t *mp); 376extern __uint64_t xfs_default_resblks(xfs_mount_t *mp);
325extern int xfs_mountfs(xfs_mount_t *mp); 377extern int xfs_mountfs(xfs_mount_t *mp);
diff --git a/fs/xfs/xfs_symlink_remote.c b/fs/xfs/xfs_symlink_remote.c
index a31852471885..01c85e3f6470 100644
--- a/fs/xfs/xfs_symlink_remote.c
+++ b/fs/xfs/xfs_symlink_remote.c
@@ -21,6 +21,7 @@
21#include "xfs_format.h" 21#include "xfs_format.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_trans.h" 23#include "xfs_trans.h"
24#include "xfs_ag.h"
24#include "xfs_sb.h" 25#include "xfs_sb.h"
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_bmap_btree.h" 27#include "xfs_bmap_btree.h"