From 22a1b359cb17a8e812bbda8d344f808369740f2e Mon Sep 17 00:00:00 2001 From: pravins Date: Mon, 19 May 2008 15:23:10 +0000 Subject: [PATCH] b=14230 i=amit.sharma i=tappro umds cleanup: use pid instead of current * to have portability. --- lustre/include/obd.h | 2 +- lustre/lov/lov_merge.c | 4 ++-- lustre/lov/lov_obd.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 67d10f6..40f1caa 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -105,7 +105,7 @@ struct lov_array_info { struct lov_stripe_md { spinlock_t lsm_lock; - void *lsm_lock_owner; /* debugging */ + pid_t lsm_lock_owner; /* debugging */ struct { /* Public members. */ diff --git a/lustre/lov/lov_merge.c b/lustre/lov/lov_merge.c index 802e546..97123f8 100644 --- a/lustre/lov/lov_merge.c +++ b/lustre/lov/lov_merge.c @@ -60,7 +60,7 @@ int lov_merge_lvb(struct obd_export *exp, struct lov_stripe_md *lsm, LASSERT_SPIN_LOCKED(&lsm->lsm_lock); #ifdef __KERNEL__ - LASSERT(lsm->lsm_lock_owner == cfs_current()); + LASSERT(lsm->lsm_lock_owner == cfs_curproc_pid()); #endif for (i = 0; i < lsm->lsm_stripe_count; i++) { @@ -113,7 +113,7 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm, LASSERT_SPIN_LOCKED(&lsm->lsm_lock); #ifdef __KERNEL__ - LASSERT(lsm->lsm_lock_owner == cfs_current()); + LASSERT(lsm->lsm_lock_owner == cfs_curproc_pid()); #endif if (shrink) { diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index a7ee2ef..6e6844e 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -2693,17 +2693,17 @@ int lov_complete_many(struct obd_export *exp, struct lov_stripe_md *lsm, void lov_stripe_lock(struct lov_stripe_md *md) { - LASSERT(md->lsm_lock_owner != cfs_current()); + LASSERT(md->lsm_lock_owner != cfs_curproc_pid()); spin_lock(&md->lsm_lock); - LASSERT(md->lsm_lock_owner == NULL); - md->lsm_lock_owner = cfs_current(); + LASSERT(md->lsm_lock_owner == 0); + md->lsm_lock_owner = cfs_curproc_pid(); } EXPORT_SYMBOL(lov_stripe_lock); void lov_stripe_unlock(struct lov_stripe_md *md) { - LASSERT(md->lsm_lock_owner == cfs_current()); - md->lsm_lock_owner = NULL; + LASSERT(md->lsm_lock_owner == cfs_curproc_pid()); + md->lsm_lock_owner = 0; spin_unlock(&md->lsm_lock); } EXPORT_SYMBOL(lov_stripe_unlock); -- 1.8.3.1