aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c29
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 /*