aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r--fs/xfs/xfs_mount.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index e5f396ff9a3d..82304b94646d 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -18,6 +18,7 @@
18#ifndef __XFS_MOUNT_H__ 18#ifndef __XFS_MOUNT_H__
19#define __XFS_MOUNT_H__ 19#define __XFS_MOUNT_H__
20 20
21
21typedef struct xfs_trans_reservations { 22typedef struct xfs_trans_reservations {
22 uint tr_write; /* extent alloc trans */ 23 uint tr_write; /* extent alloc trans */
23 uint tr_itruncate; /* truncate trans */ 24 uint tr_itruncate; /* truncate trans */
@@ -306,11 +307,13 @@ typedef struct xfs_icsb_cnts {
306#define XFS_ICSB_LAZY_COUNT (1 << 1) /* accuracy not needed */ 307#define XFS_ICSB_LAZY_COUNT (1 << 1) /* accuracy not needed */
307 308
308extern int xfs_icsb_init_counters(struct xfs_mount *); 309extern int xfs_icsb_init_counters(struct xfs_mount *);
309extern void xfs_icsb_sync_counters_lazy(struct xfs_mount *); 310extern void xfs_icsb_reinit_counters(struct xfs_mount *);
311extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int);
310 312
311#else 313#else
312#define xfs_icsb_init_counters(mp) (0) 314#define xfs_icsb_init_counters(mp) (0)
313#define xfs_icsb_sync_counters_lazy(mp) do { } while (0) 315#define xfs_icsb_reinit_counters(mp) do { } while (0)
316#define xfs_icsb_sync_counters_flags(mp, flags) do { } while (0)
314#endif 317#endif
315 318
316typedef struct xfs_mount { 319typedef struct xfs_mount {
@@ -419,6 +422,7 @@ typedef struct xfs_mount {
419 xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counters */ 422 xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counters */
420 unsigned long m_icsb_counters; /* disabled per-cpu counters */ 423 unsigned long m_icsb_counters; /* disabled per-cpu counters */
421 struct notifier_block m_icsb_notifier; /* hotplug cpu notifier */ 424 struct notifier_block m_icsb_notifier; /* hotplug cpu notifier */
425 struct mutex m_icsb_mutex; /* balancer sync lock */
422#endif 426#endif
423} xfs_mount_t; 427} xfs_mount_t;
424 428
@@ -563,11 +567,32 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d)
563} 567}
564 568
565/* 569/*
570 * Per-cpu superblock locking functions
571 */
572#ifdef HAVE_PERCPU_SB
573STATIC_INLINE void
574xfs_icsb_lock(xfs_mount_t *mp)
575{
576 mutex_lock(&mp->m_icsb_mutex);
577}
578
579STATIC_INLINE void
580xfs_icsb_unlock(xfs_mount_t *mp)
581{
582 mutex_unlock(&mp->m_icsb_mutex);
583}
584#else
585#define xfs_icsb_lock(mp)
586#define xfs_icsb_unlock(mp)
587#endif
588
589/*
566 * This structure is for use by the xfs_mod_incore_sb_batch() routine. 590 * This structure is for use by the xfs_mod_incore_sb_batch() routine.
591 * xfs_growfs can specify a few fields which are more than int limit
567 */ 592 */
568typedef struct xfs_mod_sb { 593typedef struct xfs_mod_sb {
569 xfs_sb_field_t msb_field; /* Field to modify, see below */ 594 xfs_sb_field_t msb_field; /* Field to modify, see below */
570 int msb_delta; /* Change to make to specified field */ 595 int64_t msb_delta; /* Change to make to specified field */
571} xfs_mod_sb_t; 596} xfs_mod_sb_t;
572 597
573#define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) 598#define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock))
@@ -585,17 +610,17 @@ extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
585extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *); 610extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *);
586extern int xfs_unmountfs_writesb(xfs_mount_t *); 611extern int xfs_unmountfs_writesb(xfs_mount_t *);
587extern int xfs_unmount_flush(xfs_mount_t *, int); 612extern int xfs_unmount_flush(xfs_mount_t *, int);
588extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int); 613extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int);
589extern int xfs_mod_incore_sb_unlocked(xfs_mount_t *, xfs_sb_field_t, 614extern int xfs_mod_incore_sb_unlocked(xfs_mount_t *, xfs_sb_field_t,
590 int, int); 615 int64_t, int);
591extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, 616extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *,
592 uint, int); 617 uint, int);
593extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); 618extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
594extern int xfs_readsb(xfs_mount_t *, int); 619extern int xfs_readsb(xfs_mount_t *, int);
595extern void xfs_freesb(xfs_mount_t *); 620extern void xfs_freesb(xfs_mount_t *);
596extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); 621extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
597extern int xfs_syncsub(xfs_mount_t *, int, int, int *); 622extern int xfs_syncsub(xfs_mount_t *, int, int *);
598extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *); 623extern int xfs_sync_inodes(xfs_mount_t *, int, int *);
599extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *, 624extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *,
600 xfs_agnumber_t); 625 xfs_agnumber_t);
601extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); 626extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);