diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-07-18 03:11:46 -0400 |
---|---|---|
committer | Niv Sardi <xaiki@debian.org> | 2008-07-28 02:59:25 -0400 |
commit | 9f8868ffb39c2f80ba69df4552cb530b6634f646 (patch) | |
tree | fba09366faf55ee039cdbd91dff78b7d87a86d0b /fs/xfs/linux-2.6/xfs_stats.c | |
parent | 136f8f21b6d564f553abe6130127d16fb50432d3 (diff) |
[XFS] streamline init/exit path
Currently the xfs module init/exit code is a mess. It's farmed out over a
lot of function with very little error checking. This patch makes sure we
propagate all initialization failures properly and clean up after them.
Various runtime initializations are replaced with compile-time
initializations where possible to make this easier. The exit path is
similarly consolidated.
There's now split out function to create/destroy the kmem zones and
alloc/free the trace buffers. I've also changed the ktrace allocations to
KM_MAYFAIL and handled errors resulting from that.
And yes, we really should replace the XFS_*_TRACE ifdefs with a single
XFS_TRACE..
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:31354a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_stats.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_stats.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_stats.c b/fs/xfs/linux-2.6/xfs_stats.c index e480b6102051..3d5b67c075c7 100644 --- a/fs/xfs/linux-2.6/xfs_stats.c +++ b/fs/xfs/linux-2.6/xfs_stats.c | |||
@@ -98,12 +98,21 @@ xfs_read_xfsstats( | |||
98 | return len; | 98 | return len; |
99 | } | 99 | } |
100 | 100 | ||
101 | void | 101 | int |
102 | xfs_init_procfs(void) | 102 | xfs_init_procfs(void) |
103 | { | 103 | { |
104 | if (!proc_mkdir("fs/xfs", NULL)) | 104 | if (!proc_mkdir("fs/xfs", NULL)) |
105 | return; | 105 | goto out; |
106 | create_proc_read_entry("fs/xfs/stat", 0, NULL, xfs_read_xfsstats, NULL); | 106 | |
107 | if (!create_proc_read_entry("fs/xfs/stat", 0, NULL, | ||
108 | xfs_read_xfsstats, NULL)) | ||
109 | goto out_remove_entry; | ||
110 | return 0; | ||
111 | |||
112 | out_remove_entry: | ||
113 | remove_proc_entry("fs/xfs", NULL); | ||
114 | out: | ||
115 | return -ENOMEM; | ||
107 | } | 116 | } |
108 | 117 | ||
109 | void | 118 | void |