Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2782395imu; Thu, 29 Nov 2018 10:07:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/X/qJhlrz2Q1ZKMuyZ8RjQZxFy8sIrVSOETRcrf/QbkAoOBmIWMkO9AklmxAEvc7enLhEND X-Received: by 2002:a17:902:bb86:: with SMTP id m6mr2471788pls.315.1543514844216; Thu, 29 Nov 2018 10:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543514844; cv=none; d=google.com; s=arc-20160816; b=CrvRzok2X3oMMhpn8znTgeBuSPTdkJAvn3mqkcfMYuuIIq+vzgHw5Cfm5MIbctF8aV RaXeW+3lrOKobreiyrAztOtdH/4w81qt+K2+JGhoDZQh1P4n3f7qlrWHadjLOFlJpIEg 5J01FZ5gjkEpNugakddX+APDKdPTiNL7GAA3rN42xjsZBd3oZ/1ISbAf8qYQZwQBZwdi mX0DWE5GRBcXNq69MMul92b2wKLBhi9BBp9IbDDacx/q7QCTRs5ZgToSWxbsi5JRYKUP WzyvLeuFuDLejWdhruz9B6u7fWfNLI9EooB0OiOrFvwX0OmHHrVdpfGvgBFMu+3wzUyR aZjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=l8uQa9znZatAaJ+dsg4573uJh0e3i7tztDIZSeDNr2E=; b=NdAWsHL4TQmcUS4OD9xx3tiONINm591YSYdI4KPX4K3bk1NN/IMEJW5ITuTOPU43vo /dG5IAfMMyhR6VP5eqL1s4MqhSklNtfKzX6MMC5G/UURpfw+qNg+mJSL7YFdtIfbNPQt 1I0eJwpK5yaLJy54gBHMHTb5JX17RvmSPjot3KG09lFLamEhi1dsWZwme5T3qMYi7/aV oqxSU5hz7uMv/FhHcNw5PMwtfB/24TjbO9PM+xOWrqAKGN/DseFm9LBwFhWN/nWxQwhZ dzRpXgI2FgMw0r9/FMpvd6eXc43P+xcTJRtahFH00oMwAm5hOfBFgQrXjMREYswuinmb YUKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=El6zPKl2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si2501937plk.275.2018.11.29.10.06.53; Thu, 29 Nov 2018 10:07:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=El6zPKl2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbeK3FME (ORCPT + 99 others); Fri, 30 Nov 2018 00:12:04 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36339 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbeK3FME (ORCPT ); Fri, 30 Nov 2018 00:12:04 -0500 Received: by mail-pg1-f195.google.com with SMTP id n2so1280761pgm.3 for ; Thu, 29 Nov 2018 10:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l8uQa9znZatAaJ+dsg4573uJh0e3i7tztDIZSeDNr2E=; b=El6zPKl2qxEP4MqA6R0aZwNCeTgEFy1FgcOCCdabMJgpY8PrJLP51g3LqXFwrGD0of 7aEi5opoRE+mjm5qge229YQtA7ILdFJQohY+KvKrGqsan4+cM9JPXqmR222/Nz4SztWu xaNz8zf8gMK5yf2+0LCzdhAg5Qjwm1yFlrpsNQyBGOtqwHHrFJjIh49KgeSLga8CXLCV 6Xduc6vk2CsBf2zEtxDASS8c8jbQMlRYpE9w5eBrdpMULfSJElVKaPty/LGDujjwUZKg 7BZAVAcPuSWIdsbslenEcZ7bB0bos1zkJ3tORra/mB0FrkOXYHBOo8qB4YFt8V4i36IM QGgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l8uQa9znZatAaJ+dsg4573uJh0e3i7tztDIZSeDNr2E=; b=cne+18cj+DSK4GOJ9Y6N+KS+ZYVKBU8Oqq/aR00/97Ml/z4KpR/Dsucumwb7GrP5Mg PqeObyZpzC8XdyLVp1rd+LkYXsLwU9FIr47RY8cZ9vDP+EP8ytPZf97cihQYDnzfNquL ZbNVQTFyRNGtm56GCaxih30dgBlp8LE2J0bcwC5PiUqR7H4KY5LTF4mbW5mCTemzu6O0 f1uDh3nAGjQPYizOn5QnmEl4ywQ8y9tkc8jimbmDucPxG66ES0r6jpAm/hW1m2ZkOk0Q h6BPSm2bRVyZwMcSi+1Y86cHu4Vo95KSQlwYx4zLm6FtqCAA+muc4YsXhzeUBnjBtPKb OTDQ== X-Gm-Message-State: AA+aEWawOU9l4tqZJ8mqhBVfE2XNEzhRtvh135sE4Rz+wZe+OvS8CCMj LZ2XeBDOH0WTKwq6WMJV46g= X-Received: by 2002:a63:d949:: with SMTP id e9mr2103443pgj.24.1543514750609; Thu, 29 Nov 2018 10:05:50 -0800 (PST) Received: from localhost.localdomain ([2620:0:1008:fd00:78b4:3a07:980a:287b]) by smtp.gmail.com with ESMTPSA id m20sm3144867pgb.56.2018.11.29.10.05.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 10:05:49 -0800 (PST) From: Andrei Vagin To: Andrew Morton Cc: Oleg Nesterov , linux-kernel@vger.kernel.org, "Eric W. Biederman" , Andrei Vagin Subject: [PATCH] include: replace tsk to task in linux/sched/signal.h Date: Thu, 29 Nov 2018 10:05:47 -0800 Message-Id: <20181129180547.15976-1-avagin@gmail.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181121181650.8d2d6abcf83b9defb7195cd3@linux-foundation.org> References: <20181121181650.8d2d6abcf83b9defb7195cd3@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This file uses "task" 85 times and "tsk" 25 times. It should be better to choose one of these variants. Signed-off-by: Andrei Vagin --- include/linux/sched/signal.h | 51 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 76b8399b17f6..0c3e396dca04 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -270,17 +270,18 @@ static inline int signal_group_exit(const struct signal_struct *sig) extern void flush_signals(struct task_struct *); extern void ignore_signals(struct task_struct *); extern void flush_signal_handlers(struct task_struct *, int force_default); -extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, kernel_siginfo_t *info); +extern int dequeue_signal(struct task_struct *task, + sigset_t *mask, kernel_siginfo_t *info); static inline int kernel_dequeue_signal(void) { - struct task_struct *tsk = current; + struct task_struct *task = current; kernel_siginfo_t __info; int ret; - spin_lock_irq(&tsk->sighand->siglock); - ret = dequeue_signal(tsk, &tsk->blocked, &__info); - spin_unlock_irq(&tsk->sighand->siglock); + spin_lock_irq(&task->sighand->siglock); + ret = dequeue_signal(task, &task->blocked, &__info); + spin_unlock_irq(&task->sighand->siglock); return ret; } @@ -418,18 +419,18 @@ static inline void set_restore_sigmask(void) WARN_ON(!test_thread_flag(TIF_SIGPENDING)); } -static inline void clear_tsk_restore_sigmask(struct task_struct *tsk) +static inline void clear_tsk_restore_sigmask(struct task_struct *task) { - clear_tsk_thread_flag(tsk, TIF_RESTORE_SIGMASK); + clear_tsk_thread_flag(task, TIF_RESTORE_SIGMASK); } static inline void clear_restore_sigmask(void) { clear_thread_flag(TIF_RESTORE_SIGMASK); } -static inline bool test_tsk_restore_sigmask(struct task_struct *tsk) +static inline bool test_tsk_restore_sigmask(struct task_struct *task) { - return test_tsk_thread_flag(tsk, TIF_RESTORE_SIGMASK); + return test_tsk_thread_flag(task, TIF_RESTORE_SIGMASK); } static inline bool test_restore_sigmask(void) { @@ -448,9 +449,9 @@ static inline void set_restore_sigmask(void) current->restore_sigmask = true; WARN_ON(!test_thread_flag(TIF_SIGPENDING)); } -static inline void clear_tsk_restore_sigmask(struct task_struct *tsk) +static inline void clear_tsk_restore_sigmask(struct task_struct *task) { - tsk->restore_sigmask = false; + task->restore_sigmask = false; } static inline void clear_restore_sigmask(void) { @@ -460,9 +461,9 @@ static inline bool test_restore_sigmask(void) { return current->restore_sigmask; } -static inline bool test_tsk_restore_sigmask(struct task_struct *tsk) +static inline bool test_tsk_restore_sigmask(struct task_struct *task) { - return tsk->restore_sigmask; + return task->restore_sigmask; } static inline bool test_and_clear_restore_sigmask(void) { @@ -616,9 +617,9 @@ static inline struct pid *task_session(struct task_struct *task) return task->signal->pids[PIDTYPE_SID]; } -static inline int get_nr_threads(struct task_struct *tsk) +static inline int get_nr_threads(struct task_struct *task) { - return tsk->signal->nr_threads; + return task->signal->nr_threads; } static inline bool thread_group_leader(struct task_struct *p) @@ -657,35 +658,35 @@ static inline int thread_group_empty(struct task_struct *p) #define delay_group_leader(p) \ (thread_group_leader(p) && !thread_group_empty(p)) -extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, +extern struct sighand_struct *__lock_task_sighand(struct task_struct *task, unsigned long *flags); -static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk, +static inline struct sighand_struct *lock_task_sighand(struct task_struct *task, unsigned long *flags) { struct sighand_struct *ret; - ret = __lock_task_sighand(tsk, flags); - (void)__cond_lock(&tsk->sighand->siglock, ret); + ret = __lock_task_sighand(task, flags); + (void)__cond_lock(&task->sighand->siglock, ret); return ret; } -static inline void unlock_task_sighand(struct task_struct *tsk, +static inline void unlock_task_sighand(struct task_struct *task, unsigned long *flags) { - spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); + spin_unlock_irqrestore(&task->sighand->siglock, *flags); } -static inline unsigned long task_rlimit(const struct task_struct *tsk, +static inline unsigned long task_rlimit(const struct task_struct *task, unsigned int limit) { - return READ_ONCE(tsk->signal->rlim[limit].rlim_cur); + return READ_ONCE(task->signal->rlim[limit].rlim_cur); } -static inline unsigned long task_rlimit_max(const struct task_struct *tsk, +static inline unsigned long task_rlimit_max(const struct task_struct *task, unsigned int limit) { - return READ_ONCE(tsk->signal->rlim[limit].rlim_max); + return READ_ONCE(task->signal->rlim[limit].rlim_max); } static inline unsigned long rlimit(unsigned int limit) -- 2.17.2