X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fntfs%2Findex.c;h=9f5427c2d1057d1652a60b1a0e3e317d48415518;hb=7a1f7716a86de856303ff47c2e990a7082eef013;hp=71bd2cd7a4d99f4b9e1ea003c34b2dab4e6d95ef;hpb=f3b843e558cd01b1e629d000e2865812b7fd91a4;p=linux-2.6.git diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c index 71bd2cd7a..9f5427c2d 100644 --- a/fs/ntfs/index.c +++ b/fs/ntfs/index.c @@ -1,7 +1,7 @@ /* * index.c - NTFS kernel index handling. Part of the Linux-NTFS project. * - * Copyright (c) 2004 Anton Altaparmakov + * Copyright (c) 2004-2005 Anton Altaparmakov * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -32,25 +32,15 @@ * Allocate a new index context, initialize it with @idx_ni and return it. * Return NULL if allocation failed. * - * Locking: Caller must hold i_sem on the index inode. + * Locking: Caller must hold i_mutex on the index inode. */ ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *idx_ni) { ntfs_index_context *ictx; ictx = kmem_cache_alloc(ntfs_index_ctx_cache, SLAB_NOFS); - if (ictx) { - ictx->idx_ni = idx_ni; - ictx->entry = NULL; - ictx->data = NULL; - ictx->data_len = 0; - ictx->is_in_root = 0; - ictx->ir = NULL; - ictx->actx = NULL; - ictx->base_ni = NULL; - ictx->ia = NULL; - ictx->page = NULL; - } + if (ictx) + *ictx = (ntfs_index_context){ .idx_ni = idx_ni }; return ictx; } @@ -60,7 +50,7 @@ ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *idx_ni) * * Release the index context @ictx, releasing all associated resources. * - * Locking: Caller must hold i_sem on the index inode. + * Locking: Caller must hold i_mutex on the index inode. */ void ntfs_index_ctx_put(ntfs_index_context *ictx) { @@ -116,7 +106,7 @@ void ntfs_index_ctx_put(ntfs_index_context *ictx) * or ntfs_index_entry_write() before the call to ntfs_index_ctx_put() to * ensure that the changes are written to disk. * - * Locking: - Caller must hold i_sem on the index inode. + * Locking: - Caller must hold i_mutex on the index inode. * - Each page cache page in the index allocation mapping must be * locked whilst being accessed otherwise we may find a corrupt * page due to it being under ->writepage at the moment which @@ -215,6 +205,7 @@ int ntfs_index_lookup(const void *key, const int key_len, &ie->key, key_len)) { ir_done: ictx->is_in_root = TRUE; + ictx->ir = ir; ictx->actx = actx; ictx->base_ni = base_ni; ictx->ia = NULL;