* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
__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(&cfs_fs_pwd(current->fs)->d_count));
- LASSERT(atomic_read(&new_ctx->pwd->d_count));
+ 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->luc.luc_umask = cfs_curproc_umask();
save->ngroups = current_cred()->group_info->ngroups;
LASSERT(save->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:
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);
}