staging: lustre: remove current_pid() and current_comm()
Just use current->pid and current->comm directly, instead of having wrappers. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7b8e2026fb
commit
63fd7d0458
@ -48,10 +48,6 @@
|
||||
* kernel_cap_t
|
||||
*/
|
||||
|
||||
/* check if task is running in compat mode.*/
|
||||
#define current_pid() (current->pid)
|
||||
#define current_comm() (current->comm)
|
||||
|
||||
typedef u32 cfs_cap_t;
|
||||
|
||||
#define CFS_CAP_FS_MASK (BIT(CAP_CHOWN) | \
|
||||
|
@ -373,7 +373,7 @@ void libcfs_debug_dumplog(void)
|
||||
add_wait_queue(&debug_ctlwq, &wait);
|
||||
|
||||
dumper = kthread_run(libcfs_debug_dumplog_thread,
|
||||
(void *)(long)current_pid(),
|
||||
(void *)(long)current->pid,
|
||||
"libcfs_debug_dumper");
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (IS_ERR(dumper))
|
||||
|
@ -1558,7 +1558,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
|
||||
|
||||
lock->l_req_mode = mode;
|
||||
lock->l_ast_data = data;
|
||||
lock->l_pid = current_pid();
|
||||
lock->l_pid = current->pid;
|
||||
if (cbs) {
|
||||
lock->l_blocking_ast = cbs->lcs_blocking;
|
||||
lock->l_completion_ast = cbs->lcs_completion;
|
||||
|
@ -1140,7 +1140,7 @@ dentry_may_statahead(struct inode *dir, struct dentry *dentry)
|
||||
return false;
|
||||
|
||||
/* not the same process, don't statahead */
|
||||
if (lli->lli_opendir_pid != current_pid())
|
||||
if (lli->lli_opendir_pid != current->pid)
|
||||
return false;
|
||||
|
||||
/*
|
||||
|
@ -1075,7 +1075,7 @@ static int ll_statahead_thread(void *arg)
|
||||
CDEBUG(D_READA, "Statahead for dir " DFID " hit ratio too low: hit/miss %llu/%llu, sent/replied %llu/%llu, stopping statahead thread: pid %d\n",
|
||||
PFID(&lli->lli_fid), sai->sai_hit,
|
||||
sai->sai_miss, sai->sai_sent,
|
||||
sai->sai_replied, current_pid());
|
||||
sai->sai_replied, current->pid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1147,7 +1147,7 @@ void ll_authorize_statahead(struct inode *dir, void *key)
|
||||
*/
|
||||
LASSERT(!lli->lli_opendir_pid);
|
||||
lli->lli_opendir_key = key;
|
||||
lli->lli_opendir_pid = current_pid();
|
||||
lli->lli_opendir_pid = current->pid;
|
||||
lli->lli_sa_enabled = 1;
|
||||
}
|
||||
spin_unlock(&lli->lli_sa_lock);
|
||||
@ -1506,7 +1506,7 @@ static int start_statahead_thread(struct inode *dir, struct dentry *dentry)
|
||||
atomic_inc(&ll_i2sbi(parent->d_inode)->ll_sa_running);
|
||||
|
||||
CDEBUG(D_READA, "start statahead thread: [pid %d] [parent %pd]\n",
|
||||
current_pid(), parent);
|
||||
current->pid, parent);
|
||||
|
||||
task = kthread_create(ll_statahead_thread, parent, "ll_sa_%u",
|
||||
lli->lli_opendir_pid);
|
||||
|
@ -56,7 +56,7 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
|
||||
int rc = 0;
|
||||
|
||||
assert_spin_locked(&lsm->lsm_lock);
|
||||
LASSERT(lsm->lsm_lock_owner == current_pid());
|
||||
LASSERT(lsm->lsm_lock_owner == current->pid);
|
||||
|
||||
CDEBUG(D_INODE, "MDT ID " DOSTID " initial value: s=%llu m=%llu a=%llu c=%llu b=%llu\n",
|
||||
POSTID(&lsm->lsm_oi), lvb->lvb_size, lvb->lvb_mtime,
|
||||
|
@ -1297,16 +1297,16 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
|
||||
void lov_stripe_lock(struct lov_stripe_md *md)
|
||||
__acquires(&md->lsm_lock)
|
||||
{
|
||||
LASSERT(md->lsm_lock_owner != current_pid());
|
||||
LASSERT(md->lsm_lock_owner != current->pid);
|
||||
spin_lock(&md->lsm_lock);
|
||||
LASSERT(md->lsm_lock_owner == 0);
|
||||
md->lsm_lock_owner = current_pid();
|
||||
md->lsm_lock_owner = current->pid;
|
||||
}
|
||||
|
||||
void lov_stripe_unlock(struct lov_stripe_md *md)
|
||||
__releases(&md->lsm_lock)
|
||||
{
|
||||
LASSERT(md->lsm_lock_owner == current_pid());
|
||||
LASSERT(md->lsm_lock_owner == current->pid);
|
||||
md->lsm_lock_owner = 0;
|
||||
spin_unlock(&md->lsm_lock);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ int lustre_get_jobid(char *jobid)
|
||||
/* Use process name + fsuid as jobid */
|
||||
if (strcmp(obd_jobid_var, JOBSTATS_PROCNAME_UID) == 0) {
|
||||
snprintf(jobid, LUSTRE_JOBID_SIZE, "%s.%u",
|
||||
current_comm(),
|
||||
current->comm,
|
||||
from_kuid(&init_user_ns, current_fsuid()));
|
||||
return 0;
|
||||
}
|
||||
|
@ -2296,7 +2296,7 @@ static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
|
||||
goto out;
|
||||
default:
|
||||
CDEBUG(D_INODE, "unrecognised ioctl %#x by %s\n",
|
||||
cmd, current_comm());
|
||||
cmd, current->comm);
|
||||
err = -ENOTTY;
|
||||
goto out;
|
||||
}
|
||||
|
@ -1552,7 +1552,7 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
|
||||
|
||||
lustre_msg_set_last_xid(req->rq_reqmsg, min_xid);
|
||||
|
||||
lustre_msg_set_status(req->rq_reqmsg, current_pid());
|
||||
lustre_msg_set_status(req->rq_reqmsg, current->pid);
|
||||
|
||||
rc = sptlrpc_req_refresh_ctx(req, -1);
|
||||
if (rc) {
|
||||
@ -1567,7 +1567,7 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
|
||||
}
|
||||
|
||||
CDEBUG(D_RPCTRACE, "Sending RPC pname:cluuid:pid:xid:nid:opc %s:%s:%d:%llu:%s:%d\n",
|
||||
current_comm(),
|
||||
current->comm,
|
||||
imp->imp_obd->obd_uuid.uuid,
|
||||
lustre_msg_get_status(req->rq_reqmsg), req->rq_xid,
|
||||
libcfs_nid2str(imp->imp_connection->c_peer.nid),
|
||||
@ -1978,7 +1978,7 @@ interpret:
|
||||
|
||||
CDEBUG(req->rq_reqmsg ? D_RPCTRACE : 0,
|
||||
"Completed RPC pname:cluuid:pid:xid:nid:opc %s:%s:%d:%llu:%s:%d\n",
|
||||
current_comm(), imp->imp_obd->obd_uuid.uuid,
|
||||
current->comm, imp->imp_obd->obd_uuid.uuid,
|
||||
lustre_msg_get_status(req->rq_reqmsg), req->rq_xid,
|
||||
libcfs_nid2str(imp->imp_connection->c_peer.nid),
|
||||
lustre_msg_get_opc(req->rq_reqmsg));
|
||||
@ -2760,7 +2760,7 @@ int ptlrpc_queue_wait(struct ptlrpc_request *req)
|
||||
}
|
||||
|
||||
/* for distributed debugging */
|
||||
lustre_msg_set_status(req->rq_reqmsg, current_pid());
|
||||
lustre_msg_set_status(req->rq_reqmsg, current->pid);
|
||||
|
||||
/* add a ref for the set (see comment in ptlrpc_set_add_req) */
|
||||
ptlrpc_request_addref(req);
|
||||
|
@ -1679,7 +1679,7 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt,
|
||||
}
|
||||
|
||||
CDEBUG(D_RPCTRACE, "Handling RPC pname:cluuid+ref:pid:xid:nid:opc %s:%s+%d:%d:x%llu:%s:%d\n",
|
||||
current_comm(),
|
||||
current->comm,
|
||||
(request->rq_export ?
|
||||
(char *)request->rq_export->exp_client_uuid.uuid : "0"),
|
||||
(request->rq_export ?
|
||||
@ -1723,7 +1723,7 @@ put_conn:
|
||||
arrived_usecs = arrived.tv_sec * USEC_PER_SEC +
|
||||
arrived.tv_nsec / NSEC_PER_USEC;
|
||||
CDEBUG(D_RPCTRACE, "Handled RPC pname:cluuid+ref:pid:xid:nid:opc %s:%s+%d:%d:x%llu:%s:%d Request processed in %ldus (%ldus total) trans %llu rc %d/%d\n",
|
||||
current_comm(),
|
||||
current->comm,
|
||||
(request->rq_export ?
|
||||
(char *)request->rq_export->exp_client_uuid.uuid : "0"),
|
||||
(request->rq_export ?
|
||||
@ -2018,7 +2018,7 @@ static int ptlrpc_main(void *arg)
|
||||
struct lu_env *env;
|
||||
int counter = 0, rc = 0;
|
||||
|
||||
thread->t_pid = current_pid();
|
||||
thread->t_pid = current->pid;
|
||||
unshare_fs_struct();
|
||||
|
||||
/* NB: we will call cfs_cpt_bind() for all threads, because we
|
||||
|
Loading…
x
Reference in New Issue
Block a user