aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2015-02-23 05:19:53 -0500
committerDave Chinner <david@fromorbit.com>2015-02-23 05:19:53 -0500
commite88b64ea1f3da64dbb52636377be295c90367377 (patch)
tree0031d3ed6f296981fdcd2b9f4cf3cebc8b557ab8 /fs/xfs/xfs_mount.h
parent501ab32387533924b211cacff36d19296414ec0b (diff)
xfs: use generic percpu counters for free inode counter
XFS has hand-rolled per-cpu counters for the superblock since before there was any generic implementation. The free inode counter is not used for any limit enforcement - the per-AG free inode counters are used during allocation to determine if there are inode available for allocation. Hence we don't need any of the complexity of the hand-rolled counters and we can simply replace them with generic per-cpu counters similar to the inode counter. This version introduces a xfs_mod_ifree() helper function from Christoph Hellwig. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r--fs/xfs/xfs_mount.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 76b18c8c58c5..7ce997d43d81 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -84,6 +84,7 @@ typedef struct xfs_mount {
84 struct xfs_sb m_sb; /* copy of fs superblock */ 84 struct xfs_sb m_sb; /* copy of fs superblock */
85 spinlock_t m_sb_lock; /* sb counter lock */ 85 spinlock_t m_sb_lock; /* sb counter lock */
86 struct percpu_counter m_icount; /* allocated inodes counter */ 86 struct percpu_counter m_icount; /* allocated inodes counter */
87 struct percpu_counter m_ifree; /* free inodes counter */
87 88
88 struct xfs_buf *m_sb_bp; /* buffer for superblock */ 89 struct xfs_buf *m_sb_bp; /* buffer for superblock */
89 char *m_fsname; /* filesystem name */ 90 char *m_fsname; /* filesystem name */
@@ -391,6 +392,7 @@ extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int);
391extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, 392extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *,
392 uint, int); 393 uint, int);
393extern int xfs_mod_icount(struct xfs_mount *mp, int64_t delta); 394extern int xfs_mod_icount(struct xfs_mount *mp, int64_t delta);
395extern int xfs_mod_ifree(struct xfs_mount *mp, int64_t delta);
394extern int xfs_mount_log_sb(xfs_mount_t *); 396extern int xfs_mount_log_sb(xfs_mount_t *);
395extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); 397extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
396extern int xfs_readsb(xfs_mount_t *, int); 398extern int xfs_readsb(xfs_mount_t *, int);