diff --git a/xfs/Makefile b/xfs/Makefile index ba17121..904372b 100644 --- a/xfs/Makefile +++ b/xfs/Makefile @@ -91,7 +91,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_dir2_trace.o diff --git a/xfs/linux-2.6/xfs_super.c b/xfs/linux-2.6/xfs_super.c index 9eaddb4..57f2558 100644 --- a/xfs/linux-2.6/xfs_super.c +++ b/xfs/linux-2.6/xfs_super.c @@ -1152,6 +1152,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); } @@ -1783,6 +1786,9 @@ xfs_fs_fill_super( xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); kfree(args); +#ifdef CONFIG_SYSFS + xfs_event_alloc(mp); +#endif return 0; out_filestream_unmount: @@ -2151,6 +2157,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: @@ -2184,6 +2194,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 a4503f5..2854b00 100644 --- a/xfs/xfs_mount.c +++ b/xfs/xfs_mount.c @@ -2441,3 +2441,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 b6b8be8..a7c17fe 100644 --- a/xfs/xfs_mount.h +++ b/xfs/xfs_mount.h @@ -342,6 +342,9 @@ typedef struct xfs_mount { int m_sync_seq; /* sync thread generation no. */ wait_queue_head_t m_wait_single_sync_task; struct vfsmount *m_vfsmount; +#ifdef CONFIG_SYSFS + void *event_onlow; +#endif } xfs_mount_t; /* @@ -540,6 +543,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__ */ #endif /* __XFS_MOUNT_H__ */