From: Eric Paris <eparis@redhat.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, hch@infradead.org, agruen@suse.de,
eparis@redhat.com
Subject: [PATCH 4/4] fsnotify: clear marks to 0 in fsnotify_init_mark
Date: Wed, 02 Dec 2009 09:15:12 -0500 [thread overview]
Message-ID: <20091202141511.12819.48242.stgit@paris.rdu.redhat.com> (raw)
In-Reply-To: <20091202141452.12819.93536.stgit@paris.rdu.redhat.com>
Currently fsnotify_init_mark sets some fields to 0/NULL. Some users
already used some sorts of zalloc, some didn't. This patch uses memset to
explicitly zero everything in the fsnotify_mark when it is initialized so we
don't have to be careful if fields are later added to marks.
Signed-off-by: Eric Paris <eparis@redhat.com>
---
fs/notify/mark.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index e56e876..57bb1d7 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -284,11 +284,8 @@ void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *ol
void fsnotify_init_mark(struct fsnotify_mark *mark,
void (*free_mark)(struct fsnotify_mark *mark))
{
+ memset(mark, 0, sizeof(*mark));
spin_lock_init(&mark->lock);
atomic_set(&mark->refcnt, 1);
- INIT_HLIST_NODE(&mark->i.i_list);
- mark->group = NULL;
- mark->mask = 0;
- mark->i.inode = NULL;
mark->free_mark = free_mark;
}
prev parent reply other threads:[~2009-12-02 14:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 14:14 [PATCH 1/4] fanotify: create_fd cleanup Eric Paris
2009-12-02 14:14 ` [PATCH 2/4] fanotify: Add pids to events Eric Paris
2010-01-15 4:41 ` Matthew Helsley
[not found] ` <6a12d2f31001142041j7f917b07l1e1a728790175321-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-15 15:12 ` Andreas Gruenbacher
2010-01-15 21:21 ` Matt Helsley
2010-01-16 22:53 ` Andreas Gruenbacher
2010-01-17 3:44 ` Matt Helsley
2009-12-02 14:15 ` [PATCH 3/4] fsnotify: split generic and inode specific mark code Eric Paris
2009-12-02 14:15 ` Eric Paris [this message]
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=20091202141511.12819.48242.stgit@paris.rdu.redhat.com \
--to=eparis@redhat.com \
--cc=agruen@suse.de \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).