From patchwork Fri Jan 20 13:21:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9528449 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 54C1160459 for ; Fri, 20 Jan 2017 13:54:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4733E28608 for ; Fri, 20 Jan 2017 13:54:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C47B28677; Fri, 20 Jan 2017 13:54:50 +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=-6.9 required=2.0 tests=BAYES_00,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 B159328608 for ; Fri, 20 Jan 2017 13:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbdATNxu (ORCPT ); Fri, 20 Jan 2017 08:53:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:48992 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449AbdATNxr (ORCPT ); Fri, 20 Jan 2017 08:53:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 621EBAC88; Fri, 20 Jan 2017 13:33:54 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id B28AA1E3447; Fri, 20 Jan 2017 14:21:35 +0100 (CET) From: Jan Kara To: Cc: Amir Goldstein , Miklos Szeredi , Paul Moore , Jan Kara Subject: [PATCH 17/22] fsnotify: Rename fsnotify_clear_marks_by_group_flags() Date: Fri, 20 Jan 2017 14:21:18 +0100 Message-Id: <20170120132123.9670-18-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170120132123.9670-1-jack@suse.cz> References: <20170120132123.9670-1-jack@suse.cz> 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 _flags() suffix in the function name was more confusing than explaining so just remove it. Also rename the argument from 'flags' to 'type' to better explain what the function expects. Suggested-by: Amir Goldstein Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/mark.c | 12 +++++------- include/linux/fsnotify_backend.h | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 18184f26ec68..5eba0f4e9677 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -67,7 +67,7 @@ * - The fs the inode is on is unmounted. (fsnotify_inode_delete/fsnotify_unmount_inodes) * - Something explicitly requests that it be removed. (fsnotify_destroy_mark) * - The fsnotify_group associated with the mark is going away and all such marks - * need to be cleaned up. (fsnotify_clear_marks_by_group) + * need to be cleaned up. (fsnotify_detach_group_marks) * * This has the very interesting property of being able to run concurrently with * any (or all) other directions. @@ -630,11 +630,9 @@ struct fsnotify_mark *fsnotify_find_mark(struct fsnotify_mark_connector **connp, return NULL; } -/* - * clear any marks in a group in which mark->flags & flags is true - */ -void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, - unsigned int flags) +/* Clear any marks in a group with given type */ +void fsnotify_clear_marks_by_group(struct fsnotify_group *group, + unsigned int type) { struct fsnotify_mark *lmark, *mark; LIST_HEAD(to_free); @@ -650,7 +648,7 @@ void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, */ mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING); list_for_each_entry_safe(mark, lmark, &group->marks_list, g_list) { - if (mark->connector->flags & flags) + if (mark->connector->flags & type) list_move(&mark->g_list, &to_free); } mutex_unlock(&group->mark_mutex); diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 86586aa022ce..680b7e92101b 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -354,16 +354,16 @@ extern void fsnotify_detach_mark(struct fsnotify_mark *mark); /* free mark */ extern void fsnotify_free_mark(struct fsnotify_mark *mark); /* run all the marks in a group, and clear all of the marks attached to given object type */ -extern void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, unsigned int flags); +extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type); /* run all the marks in a group, and clear all of the vfsmount marks */ static inline void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group) { - fsnotify_clear_marks_by_group_flags(group, FSNOTIFY_OBJ_TYPE_VFSMOUNT); + fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_VFSMOUNT); } /* run all the marks in a group, and clear all of the inode marks */ static inline void fsnotify_clear_inode_marks_by_group(struct fsnotify_group *group) { - fsnotify_clear_marks_by_group_flags(group, FSNOTIFY_OBJ_TYPE_INODE); + fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_INODE); } extern void fsnotify_get_mark(struct fsnotify_mark *mark); extern void fsnotify_put_mark(struct fsnotify_mark *mark);