diff options
author | Christoph Hellwig <hch@sgi.com> | 2005-11-01 23:09:35 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 23:09:35 -0500 |
commit | 7f14d0a013eeae8f8548e9ac10699465de2adacc (patch) | |
tree | 5cd9b7b778f48c4d942b901ac6881cc4f6b43152 /fs/xfs/linux-2.6/xfs_buf.c | |
parent | e718eeb4fe397f8add9f789e1fc3b47da4e7275f (diff) |
[XFS] Simplify pagebuf_rele Remove a conditional that can not be true
anymore and simplify the final put path a little
SGI-PV: 908809
SGI-Modid: xfs-linux:xfs-kern:200790a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index e22cce1a9d5d..a764ded9f3a0 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -830,39 +830,18 @@ pagebuf_rele( | |||
830 | 830 | ||
831 | PB_TRACE(pb, "rele", pb->pb_relse); | 831 | PB_TRACE(pb, "rele", pb->pb_relse); |
832 | 832 | ||
833 | /* | ||
834 | * pagebuf_lookup buffers are not hashed, not delayed write, | ||
835 | * and don't have their own release routines. Special case. | ||
836 | */ | ||
837 | if (unlikely(!hash)) { | ||
838 | ASSERT(!pb->pb_relse); | ||
839 | if (atomic_dec_and_test(&pb->pb_hold)) | ||
840 | xfs_buf_free(pb); | ||
841 | return; | ||
842 | } | ||
843 | |||
844 | if (atomic_dec_and_lock(&pb->pb_hold, &hash->bh_lock)) { | 833 | if (atomic_dec_and_lock(&pb->pb_hold, &hash->bh_lock)) { |
845 | int do_free = 1; | ||
846 | |||
847 | if (pb->pb_relse) { | 834 | if (pb->pb_relse) { |
848 | atomic_inc(&pb->pb_hold); | 835 | atomic_inc(&pb->pb_hold); |
849 | spin_unlock(&hash->bh_lock); | 836 | spin_unlock(&hash->bh_lock); |
850 | (*(pb->pb_relse)) (pb); | 837 | (*(pb->pb_relse)) (pb); |
851 | spin_lock(&hash->bh_lock); | 838 | } else if (pb->pb_flags & PBF_FS_MANAGED) { |
852 | do_free = 0; | ||
853 | } | ||
854 | |||
855 | if (pb->pb_flags & PBF_FS_MANAGED) { | ||
856 | do_free = 0; | ||
857 | } | ||
858 | |||
859 | if (do_free) { | ||
860 | ASSERT((pb->pb_flags & (PBF_DELWRI|_PBF_DELWRI_Q)) == 0); | ||
861 | list_del_init(&pb->pb_hash_list); | ||
862 | spin_unlock(&hash->bh_lock); | 839 | spin_unlock(&hash->bh_lock); |
863 | pagebuf_free(pb); | ||
864 | } else { | 840 | } else { |
841 | ASSERT(!(pb->pb_flags & (PBF_DELWRI|_PBF_DELWRI_Q))); | ||
842 | list_del_init(&pb->pb_hash_list); | ||
865 | spin_unlock(&hash->bh_lock); | 843 | spin_unlock(&hash->bh_lock); |
844 | pagebuf_free(pb); | ||
866 | } | 845 | } |
867 | } else { | 846 | } else { |
868 | /* | 847 | /* |