fsnotify: duplicate fsnotify_mark_entry data between 2 marks
authorEric Paris <eparis@redhat.com>
Fri, 18 Dec 2009 01:12:05 +0000 (20:12 -0500)
committerEric Paris <eparis@redhat.com>
Wed, 28 Jul 2010 13:58:17 +0000 (09:58 -0400)
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
include/linux/fsnotify_backend.h

index 0399bcbe09c83f02bdf1627b1dcfc6b12c316d5f..a13cf9e9233af34c1c6af8ccb853eae6c7959025 100644 (file)
@@ -282,12 +282,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);
index 8f8341e9f02126626a9d41cdeb8554ff9a0bc8d0..390516732956b10db6d30417d16b2a5ece331c22 100644 (file)
@@ -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 */
This page took 0.026486 seconds and 5 git commands to generate.