__u64 obd_max_pages = 0;
__u64 obd_max_alloc = 0;
struct lprocfs_stats *obd_memory = NULL;
-spinlock_t obd_updatemax_lock = SPIN_LOCK_UNLOCKED;
+cfs_spinlock_t obd_updatemax_lock = CFS_SPIN_LOCK_UNLOCKED;
/* refine later and change to seqlock or simlar from libcfs */
/* Debugging check only needed during development */
OBD_SET_CTXT_MAGIC(save);
save->fs = get_fs();
- LASSERT(atomic_read(¤t->fs->pwd->d_count));
- LASSERT(atomic_read(&new_ctx->pwd->d_count));
- save->pwd = dget(current->fs->pwd);
- save->pwdmnt = mntget(current->fs->pwdmnt);
+ LASSERT(cfs_atomic_read(&cfs_fs_pwd(current->fs)->d_count));
+ LASSERT(cfs_atomic_read(&new_ctx->pwd->d_count));
+ save->pwd = dget(cfs_fs_pwd(current->fs));
+ save->pwdmnt = mntget(cfs_fs_mnt(current->fs));
save->luc.luc_umask = current->fs->umask;
save->ngroups = current->group_info->ngroups;
ASSERT_CTXT_MAGIC(saved->magic);
ASSERT_KERNEL_CTXT("popping non-kernel context!\n");
- LASSERTF(current->fs->pwd == new_ctx->pwd, "%p != %p\n",
- current->fs->pwd, new_ctx->pwd);
- LASSERTF(current->fs->pwdmnt == new_ctx->pwdmnt, "%p != %p\n",
- current->fs->pwdmnt, new_ctx->pwdmnt);
+ LASSERTF(cfs_fs_pwd(current->fs) == new_ctx->pwd, "%p != %p\n",
+ cfs_fs_pwd(current->fs), new_ctx->pwd);
+ LASSERTF(cfs_fs_mnt(current->fs) == new_ctx->pwdmnt, "%p != %p\n",
+ cfs_fs_mnt(current->fs), new_ctx->pwdmnt);
set_fs(saved->fs);
ll_set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd);
if (!dirent)
return -ENOMEM;
- list_add_tail(&dirent->lld_list, buf->lrc_list);
+ cfs_list_add_tail(&dirent->lld_list, buf->lrc_list);
buf->lrc_dirent = dirent;
dirent->lld_ino = ino;
return 0;
}
-long l_readdir(struct file *file, struct list_head *dentry_list)
+long l_readdir(struct file *file, cfs_list_t *dentry_list)
{
struct l_linux_dirent *lastdirent;
struct l_readdir_callback buf;
max1 = obd_pages_sum();
max2 = obd_memory_sum();
- spin_lock(&obd_updatemax_lock);
+ cfs_spin_lock(&obd_updatemax_lock);
if (max1 > obd_max_pages)
obd_max_pages = max1;
if (max2 > obd_max_alloc)
obd_max_alloc = max2;
- spin_unlock(&obd_updatemax_lock);
+ cfs_spin_unlock(&obd_updatemax_lock);
}
{
__u64 ret;
- spin_lock(&obd_updatemax_lock);
+ cfs_spin_lock(&obd_updatemax_lock);
ret = obd_max_alloc;
- spin_unlock(&obd_updatemax_lock);
+ cfs_spin_unlock(&obd_updatemax_lock);
return ret;
}
{
__u64 ret;
- spin_lock(&obd_updatemax_lock);
+ cfs_spin_lock(&obd_updatemax_lock);
ret = obd_max_pages;
- spin_unlock(&obd_updatemax_lock);
+ cfs_spin_unlock(&obd_updatemax_lock);
return ret;
}
if (!lc)
RETURN(0);
do {
- centry = atomic_read(&lc->lc_cntl.la_entry);
+ centry = cfs_atomic_read(&lc->lc_cntl.la_entry);
switch (field) {
case LPROCFS_FIELDS_FLAGS_CONFIG:
ret = lc->lc_config;
break;
case LPROCFS_FIELDS_FLAGS_SUM:
- ret = lc->lc_sum;
+ ret = lc->lc_sum + lc->lc_sum_irq;
break;
case LPROCFS_FIELDS_FLAGS_MIN:
ret = lc->lc_min;
default:
break;
};
- } while (centry != atomic_read(&lc->lc_cntl.la_entry) &&
- centry != atomic_read(&lc->lc_cntl.la_exit));
+ } while (centry != cfs_atomic_read(&lc->lc_cntl.la_entry) &&
+ centry != cfs_atomic_read(&lc->lc_cntl.la_exit));
RETURN(ret);
}