public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: linux-audit@redhat.com
Cc: viro@ZenIV.linux.org.uk
Subject: [PATCH 4/7] fsnotify: duplicate fsnotify_mark_entry data between 2 marks
Date: Fri, 12 Jun 2009 16:32:16 -0400	[thread overview]
Message-ID: <20090612203215.12332.65305.stgit@paris.rdu.redhat.com> (raw)
In-Reply-To: <20090612203159.12332.42771.stgit@paris.rdu.redhat.com>

Simple copy fsnotify information from one mark to another in preparation
for the second mark to replace the first.

Signed-off-by: Eric Paris <eparis@redhat.com>
---

 fs/notify/inode_mark.c           |   10 +++++++++-
 include/linux/fsnotify_backend.h |    2 ++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index c8a07c6..f560ad5 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -283,12 +283,20 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou
 	return NULL;
 }
 
+void fsnotify_duplicate_mark(struct fsnotify_mark_entry *new, struct fsnotify_mark_entry *old)
+{
+	assert_spin_locked(&old->lock);
+	new->inode = old->inode;
+	new->group = old->group;
+	new->mask = old->mask;
+	new->free_mark = old->free_mark;
+}
+
 /*
  * Nothing fancy, just initialize lists and locks and counters.
  */
 void fsnotify_init_mark(struct fsnotify_mark_entry *entry,
 			void (*free_mark)(struct fsnotify_mark_entry *entry))
-
 {
 	spin_lock_init(&entry->lock);
 	atomic_set(&entry->refcnt, 1);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 90e32cc..4c187c6 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -342,6 +342,8 @@ extern void fsnotify_recalc_inode_mask(struct inode *inode);
 extern void fsnotify_init_mark(struct fsnotify_mark_entry *entry, void (*free_mark)(struct fsnotify_mark_entry *entry));
 /* find (and take a reference) to a mark associated with group and inode */
 extern struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *group, struct inode *inode);
+/* copy the values from old into new */
+extern void fsnotify_duplicate_mark(struct fsnotify_mark_entry *new, struct fsnotify_mark_entry *old);
 /* attach the mark to both the group and the inode */
 extern int fsnotify_add_mark(struct fsnotify_mark_entry *entry, struct fsnotify_group *group, struct inode *inode);
 /* given a mark, flag it to be freed when all references are dropped */

  parent reply	other threads:[~2009-06-12 20:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12 20:31 [PATCH 1/7] audit: convert audit watches to use fsnotify instead of inotify Eric Paris
2009-06-12 20:32 ` [PATCH 2/7] audit: redo audit watch locking and refcnt in light of fsnotify Eric Paris
2009-06-12 20:32 ` [PATCH 3/7] audit: do not get and put just to free a watch Eric Paris
2009-06-12 20:32 ` Eric Paris [this message]
2009-06-12 20:32 ` [PATCH 5/7] fsnotify: allow addition of duplicate fsnotify marks Eric Paris
2009-06-12 20:32 ` [PATCH 6/7] audit: reimplement audit_trees using fsnotify rather than inotify Eric Paris
2009-06-12 20:32 ` [PATCH 7/7] audit: move audit to a subdirectory Eric Paris
2009-06-16 15:25 ` [PATCH 1/7] audit: convert audit watches to use fsnotify instead of inotify Klaus Heinrich Kiwi
2009-06-16 15:43   ` Eric Paris
2009-06-16 16:09     ` Klaus Heinrich Kiwi
2009-06-19 21:03       ` 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=20090612203215.12332.65305.stgit@paris.rdu.redhat.com \
    --to=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --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