diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-07-18 17:11:46 +1000 |
---|---|---|
committer | Niv Sardi <xaiki@debian.org> | 2008-07-28 16:59:25 +1000 |
commit | 9f8868ffb39c2f80ba69df4552cb530b6634f646 (patch) | |
tree | fba09366faf55ee039cdbd91dff78b7d87a86d0b /fs/xfs/xfs_filestream.c | |
parent | 136f8f21b6d564f553abe6130127d16fb50432d3 (diff) | |
download | blackbird-op-linux-9f8868ffb39c2f80ba69df4552cb530b6634f646.tar.gz blackbird-op-linux-9f8868ffb39c2f80ba69df4552cb530b6634f646.zip |
[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/xfs_filestream.c')
-rw-r--r-- | fs/xfs/xfs_filestream.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c index 3f3785b10804..c38fd14fca29 100644 --- a/fs/xfs/xfs_filestream.c +++ b/fs/xfs/xfs_filestream.c @@ -397,10 +397,12 @@ int xfs_filestream_init(void) { item_zone = kmem_zone_init(sizeof(fstrm_item_t), "fstrm_item"); + if (!item_zone) + return -ENOMEM; #ifdef XFS_FILESTREAMS_TRACE xfs_filestreams_trace_buf = ktrace_alloc(XFS_FSTRM_KTRACE_SIZE, KM_SLEEP); #endif - return item_zone ? 0 : -ENOMEM; + return 0; } /* |