From: Jan Kara <jack@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Eric Paris <eparis@redhat.com>, Jan Kara <jack@suse.cz>
Subject: [PATCH 3/3] fsnotify: Remove destroy_list from fsnotify_mark
Date: Thu, 6 Nov 2014 14:03:40 +0100 [thread overview]
Message-ID: <1415279020-9175-4-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1415279020-9175-1-git-send-email-jack@suse.cz>
destroy_list is used to track marks which still need waiting for srcu
period end before they can be freed. However by the time mark is added
to destroy_list it isn't in group's list of marks anymore and thus we
can reuse fsnotify_mark->g_list for queueing into destroy_list. This
saves two pointers for each fsnotify_mark.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/notify/mark.c | 8 ++++----
include/linux/fsnotify_backend.h | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 70dba449c33f..b6237ce85e3e 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -150,7 +150,7 @@ void fsnotify_destroy_mark_locked(struct fsnotify_mark *mark,
mutex_unlock(&group->mark_mutex);
spin_lock(&destroy_lock);
- list_add(&mark->destroy_list, &destroy_list);
+ list_add(&mark->g_list, &destroy_list);
spin_unlock(&destroy_lock);
wake_up(&destroy_waitq);
/*
@@ -360,7 +360,7 @@ err:
spin_unlock(&mark->lock);
spin_lock(&destroy_lock);
- list_add(&mark->destroy_list, &destroy_list);
+ list_add(&mark->g_list, &destroy_list);
spin_unlock(&destroy_lock);
wake_up(&destroy_waitq);
@@ -459,8 +459,8 @@ static int fsnotify_mark_destroy(void *ignored)
synchronize_srcu(&fsnotify_mark_srcu);
- list_for_each_entry_safe(mark, next, &private_destroy_list, destroy_list) {
- list_del_init(&mark->destroy_list);
+ list_for_each_entry_safe(mark, next, &private_destroy_list, g_list) {
+ list_del_init(&mark->g_list);
fsnotify_put_mark(mark);
}
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 82022da18035..e12b81579408 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -226,7 +226,6 @@ struct fsnotify_mark {
#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08
#define FSNOTIFY_MARK_FLAG_ALIVE 0x10
unsigned int flags; /* vfsmount or inode mark? */
- struct list_head destroy_list;
void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */
};
--
1.8.1.4
next prev parent reply other threads:[~2014-11-06 13:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 13:03 [PATCH 0/3] fsnotify: Cleanups Jan Kara
2014-11-06 13:03 ` [PATCH 1/3] fsnotify: Unify inode and mount marks handling Jan Kara
2014-11-06 13:03 ` [PATCH 2/3] fsnotify: Remove free_list list_head from fsnotify_mark Jan Kara
2014-11-06 13:03 ` Jan Kara [this message]
2014-11-06 21:17 ` [PATCH 3/3] fsnotify: Remove destroy_list " Heinrich Schuchardt
2014-11-10 10:30 ` Jan Kara
2014-11-10 12:54 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415279020-9175-4-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=eparis@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).