diff --git a/xfs/Makefile b/xfs/Makefile index c3dc491..b0a1330 100644 --- a/xfs/Makefile +++ b/xfs/Makefile @@ -88,7 +88,8 @@ xfs-y += xfs_alloc.o \ xfs_vnodeops.o \ xfs_rw.o \ xfs_dmops.o \ - xfs_qmops.o + xfs_qmops.o \ + xfs_sysfs.o xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ xfs_dir2_trace.o diff --git a/xfs/linux-2.6/xfs_super.c b/xfs/linux-2.6/xfs_super.c index 32ae502..99ac6ed 100644 --- a/xfs/linux-2.6/xfs_super.c +++ b/xfs/linux-2.6/xfs_super.c @@ -1082,6 +1082,9 @@ xfs_fs_put_super( xfs_close_devices(mp); xfs_qmops_put(mp); xfs_dmops_put(mp); +#ifdef CONFIG_SYSFS + xfs_event_release(mp); +#endif xfs_free_fsname(mp); kfree(mp); } @@ -1509,6 +1512,9 @@ xfs_fs_fill_super( kfree(mtpt); +#ifdef CONFIG_SYSFS + xfs_event_alloc(mp); +#endif xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); return 0; @@ -1873,6 +1879,10 @@ init_xfs_fs(void) error = register_filesystem(&xfs_fs_type); if (error) goto out_sysctl_unregister; + +#ifdef CONFIG_SYSFS + xfs_sysfs_init(); +#endif return 0; out_sysctl_unregister: @@ -1906,6 +1916,9 @@ exit_xfs_fs(void) xfs_free_trace_bufs(); xfs_destroy_zones(); ktrace_uninit(); +#ifdef CONFIG_SYSFS + xfs_sysfs_done(); +#endif } module_init(init_xfs_fs); diff --git a/xfs/xfs_mount.c b/xfs/xfs_mount.c index 3530025..c19fc17 100644 --- a/xfs/xfs_mount.c +++ b/xfs/xfs_mount.c @@ -2413,3 +2413,25 @@ balance_counter: } #endif + + +__uint64_t xfs_icsb_get_fdblocks_lazy(xfs_mount_t *mp) +{ + __uint64_t fdblocks = 0; +#ifdef HAVE_PERCPU_SB + xfs_icsb_cnts_t *cntp; + int i; + + for_each_online_cpu(i) { + cntp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, i); + fdblocks += cntp->icsb_fdblocks; + } + + if (xfs_icsb_counter_disabled(mp, XFS_SBS_FDBLOCKS)) + fdblocks = mp->m_sb.sb_fdblocks; +#else + fdblocks = mp->m_sb.sb_fdblocks; +#endif + return fdblocks - XFS_ALLOC_SET_ASIDE(mp); +} + diff --git a/xfs/xfs_mount.h b/xfs/xfs_mount.h index f5e9937..45ef4cb 100644 --- a/xfs/xfs_mount.h +++ b/xfs/xfs_mount.h @@ -329,6 +329,9 @@ typedef struct xfs_mount { wait_queue_head_t m_wait_single_sync_task; __int64_t m_update_flags; /* sb flags we need to update on the next remount,rw */ +#ifdef CONFIG_SYSFS + void *event_onlow; +#endif } xfs_mount_t; /* @@ -528,6 +531,13 @@ extern void xfs_qmops_put(struct xfs_mount *); extern struct xfs_dmops xfs_dmcore_xfs; +#ifdef CONFIG_SYSFS +extern void xfs_sysfs_init(void); +extern void xfs_sysfs_done(void); +extern int xfs_event_alloc(struct xfs_mount *mnt); +extern int xfs_event_release(struct xfs_mount *mnt); +#endif + #endif /* __KERNEL__ */ extern void xfs_mod_sb(struct xfs_trans *, __int64_t);