From patchwork Sat Jun 23 14:54:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10483669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1ADE0601C8 for ; Sat, 23 Jun 2018 14:53:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E17F6284BD for ; Sat, 23 Jun 2018 14:53:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D47C22857F; Sat, 23 Jun 2018 14:53:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F20428C7B for ; Sat, 23 Jun 2018 14:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507AbeFWOxX (ORCPT ); Sat, 23 Jun 2018 10:53:23 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:42514 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbeFWOxW (ORCPT ); Sat, 23 Jun 2018 10:53:22 -0400 Received: by mail-wr0-f195.google.com with SMTP id w10-v6so9351350wrk.9 for ; Sat, 23 Jun 2018 07:53:21 -0700 (PDT) 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=MUhmbqhp2caFb9sOW1aWy5asJe7G6TM1Eat6lAwu44w=; b=g2HU+FHYrNc0o/zfeE1JcgIWPGorSizh34EHlWF+iakDtSBjEwvNB57l6INxDjnVyC dpbUsm6SULs47+vVxpJgDFp22ugbJRUYeUDmv3bxVAey9Nhu8DbqfbsZL8X20tNSlU5I mvMPS28m3cznHKaLGfG3eio7sNGATFStM/9Gn3acs1XbBArH819XxCzsIoEdh/+O/6nM oq5Rj3GpfzsRobAiHhXwjpDoPAUJpsmfNSMZMKJ2fu1B6QKfuFU12FR6THfZARCrIoNS yW8pKS1idy9bqYLGmVbPx4YjIoQmmoutDjSXk4Q2D4igYl8p8umntncOdYcJNXhMTxHz HjFg== 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=MUhmbqhp2caFb9sOW1aWy5asJe7G6TM1Eat6lAwu44w=; b=XRp0qMusf/jD+ankFDJfiG+w7TbWfnUQZfgJyc/amGWXzD2h4+9qrQ1nfMM5qN8Alq e7zXalW2hUGVN03r54g4+rGEu5miJSPTkko6qSjpaeS1KOi/+Eb5OdpfThLsHRd/lpCc 60eVh4Mswfs1T7/u9UnjMIoxcrvKV3KeyHcAj9JYmmcuSO2qgRcpWGqNzahbbGi9eLQB JOP/z3xvISiRG2VaMaoeU21hqLncr6V+SKb7dZ9AfmMn7UNdGY6ZjDHEDiO1UdF+J5Vd ScjjYQacDyieTbpIJCP9PWbCVJ1M0yGKRe3DdxD25mq+uoa34EilfJ9b7otgAyUjkYfx LY+A== X-Gm-Message-State: APt69E1mihcTaEHuXG6ZXu3QFG34tv9iGbShST70WZpbgyO1yVY56tlM ihSWTghYqwQi/fhoeXdFFaU= X-Google-Smtp-Source: AAOMgpdO0/K5Xxzx7don8PejNFOHcL+0VD2Qcm6wQYFKfIUuf0Ofv1AGbGy/nTcsDqlmmptwsvu1Og== X-Received: by 2002:adf:b909:: with SMTP id k9-v6mr4536245wrf.116.1529765600658; Sat, 23 Jun 2018 07:53:20 -0700 (PDT) Received: from localhost.localdomain ([5.102.238.247]) by smtp.gmail.com with ESMTPSA id w3-v6sm9478064wrr.88.2018.06.23.07.53.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 23 Jun 2018 07:53:20 -0700 (PDT) From: Amir Goldstein To: Jan Kara Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH v4 1/5] fsnotify: use typedef fsnotify_connp_t for brevity Date: Sat, 23 Jun 2018 17:54:47 +0300 Message-Id: <1529765691-25170-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529765691-25170-1-git-send-email-amir73il@gmail.com> References: <1529765691-25170-1-git-send-email-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The object marks manipulation functions fsnotify_destroy_marks() fsnotify_find_mark() and their helpers take an argument of type struct fsnotify_mark_connector __rcu ** to dereference the connector pointer. use a typedef to describe this type for brevity. Signed-off-by: Amir Goldstein --- fs/notify/fsnotify.h | 4 ++-- fs/notify/mark.c | 20 +++++++++----------- include/linux/fsnotify_backend.h | 7 ++++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h index 34515d2c4ba3..94cedf8264ba 100644 --- a/fs/notify/fsnotify.h +++ b/fs/notify/fsnotify.h @@ -19,8 +19,8 @@ extern struct srcu_struct fsnotify_mark_srcu; extern int fsnotify_compare_groups(struct fsnotify_group *a, struct fsnotify_group *b); -/* Destroy all marks connected via given connector */ -extern void fsnotify_destroy_marks(struct fsnotify_mark_connector __rcu **connp); +/* Destroy all marks attached to an object via connector */ +extern void fsnotify_destroy_marks(fsnotify_connp_t *connp); /* run the list of all marks associated with inode and destroy them */ static inline void fsnotify_clear_marks_by_inode(struct inode *inode) { diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 61f4c5fa34c7..7b595acd8ec9 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -436,10 +436,9 @@ int fsnotify_compare_groups(struct fsnotify_group *a, struct fsnotify_group *b) return -1; } -static int fsnotify_attach_connector_to_object( - struct fsnotify_mark_connector __rcu **connp, - struct inode *inode, - struct vfsmount *mnt) +static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp, + struct inode *inode, + struct vfsmount *mnt) { struct fsnotify_mark_connector *conn; @@ -476,7 +475,7 @@ static int fsnotify_attach_connector_to_object( * they are sure list cannot go away under them. */ static struct fsnotify_mark_connector *fsnotify_grab_connector( - struct fsnotify_mark_connector __rcu **connp) + fsnotify_connp_t *connp) { struct fsnotify_mark_connector *conn; int idx; @@ -508,7 +507,7 @@ static int fsnotify_add_mark_list(struct fsnotify_mark *mark, { struct fsnotify_mark *lmark, *last = NULL; struct fsnotify_mark_connector *conn; - struct fsnotify_mark_connector __rcu **connp; + fsnotify_connp_t *connp; int cmp; int err = 0; @@ -629,9 +628,8 @@ int fsnotify_add_mark(struct fsnotify_mark *mark, struct inode *inode, * Given a list of marks, find the mark associated with given group. If found * take a reference to that mark and return it, else return NULL. */ -struct fsnotify_mark *fsnotify_find_mark( - struct fsnotify_mark_connector __rcu **connp, - struct fsnotify_group *group) +struct fsnotify_mark *fsnotify_find_mark(fsnotify_connp_t *connp, + struct fsnotify_group *group) { struct fsnotify_mark_connector *conn; struct fsnotify_mark *mark; @@ -697,8 +695,8 @@ void fsnotify_clear_marks_by_group(struct fsnotify_group *group, } } -/* Destroy all marks attached to inode / vfsmount */ -void fsnotify_destroy_marks(struct fsnotify_mark_connector __rcu **connp) +/* Destroy all marks attached to an object via connector */ +void fsnotify_destroy_marks(fsnotify_connp_t *connp) { struct fsnotify_mark_connector *conn; struct fsnotify_mark *mark, *old_mark = NULL; diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index b38964a7a521..e7cd7fc6e3cf 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -268,6 +268,8 @@ struct fsnotify_mark_connector { struct hlist_head list; }; +typedef struct fsnotify_mark_connector __rcu *fsnotify_connp_t; + /* * A mark is simply an object attached to an in core inode which allows an * fsnotify listener to indicate they are either no longer interested in events @@ -394,9 +396,8 @@ extern void fsnotify_recalc_mask(struct fsnotify_mark_connector *conn); extern void fsnotify_init_mark(struct fsnotify_mark *mark, struct fsnotify_group *group); /* Find mark belonging to given group in the list of marks */ -extern struct fsnotify_mark *fsnotify_find_mark( - struct fsnotify_mark_connector __rcu **connp, - struct fsnotify_group *group); +extern struct fsnotify_mark *fsnotify_find_mark(fsnotify_connp_t *connp, + struct fsnotify_group *group); /* attach the mark to the inode or vfsmount */ extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct inode *inode, struct vfsmount *mnt, int allow_dups);