linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: eparis@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH 1/6] fsnotify: introduce new group mutex
Date: Thu, 2 Dec 2010 11:01:48 +0100	[thread overview]
Message-ID: <20101202100148.GB5196@lsanfilippo.unix.rd.tt.avira.com> (raw)


This patch intoduces a group specific mutex that is used to synchronize all 
group related data/tasks for which no dedicated lock exists yet. 

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
---
 fs/notify/group.c                |    1 +
 include/linux/fsnotify_backend.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

Please apply this against commit 9f71741c75e5206e1fea72ddf2adf5661105444d of
branch 'origin/for-next' from git.infradead.org/users/eparis/notify.git

 Eric, as you can see i chose to introduce a new mutex instead of using the 
 notification_mutex since you may be right with you concerns about performance.
 I guess its ok since its what you preferred.

diff --git a/fs/notify/group.c b/fs/notify/group.c
index d309f38..cc341d3 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -90,6 +90,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
 	 */
 	atomic_set(&group->num_marks, 1);
 
+	mutex_init(&group->mutex);
 	mutex_init(&group->notification_mutex);
 	INIT_LIST_HEAD(&group->notification_list);
 	init_waitqueue_head(&group->notification_waitq);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index add1351..6a3c660 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -125,6 +125,7 @@ struct fsnotify_group {
 
 	const struct fsnotify_ops *ops;	/* how this group handles things */
 
+	struct mutex mutex;
 	/* needed to send notification to userspace */
 	struct mutex notification_mutex;	/* protect the notification_list */
 	struct list_head notification_list;	/* list of event_holder this group needs to send to userspace */
-- 
1.5.6.5

             reply	other threads:[~2010-12-02 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 10:01 Lino Sanfilippo [this message]
2010-12-07 19:56 ` [PATCH 1/6] fsnotify: introduce new group mutex Eric Paris

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=20101202100148.GB5196@lsanfilippo.unix.rd.tt.avira.com \
    --to=linosanfilippo@gmx.de \
    --cc=eparis@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).