Release 4.11 fs/notify/vfsmount_mark.c
/*
* Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mount.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/atomic.h>
#include <linux/fsnotify_backend.h>
#include "fsnotify.h"
void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group)
{
fsnotify_clear_marks_by_group_flags(group, FSNOTIFY_MARK_FLAG_VFSMOUNT);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Paris | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
/*
* Recalculate the mnt->mnt_fsnotify_mask, or the mask of all FS_* event types
* any notifier is interested in hearing for this mount point
*/
void fsnotify_recalc_vfsmount_mask(struct vfsmount *mnt)
{
struct mount *m = real_mount(mnt);
spin_lock(&mnt->mnt_root->d_lock);
m->mnt_fsnotify_mask = fsnotify_recalc_mask(&m->mnt_fsnotify_marks);
spin_unlock(&mnt->mnt_root->d_lock);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Paris | 37 | 71.15% | 1 | 33.33% |
Al Viro | 10 | 19.23% | 1 | 33.33% |
Jan Kara | 5 | 9.62% | 1 | 33.33% |
Total | 52 | 100.00% | 3 | 100.00% |
void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark)
{
struct vfsmount *mnt = mark->mnt;
struct mount *m = real_mount(mnt);
BUG_ON(!mutex_is_locked(&mark->group->mark_mutex));
assert_spin_locked(&mark->lock);
spin_lock(&mnt->mnt_root->d_lock);
hlist_del_init_rcu(&mark->obj_list);
mark->mnt = NULL;
m->mnt_fsnotify_mask = fsnotify_recalc_mask(&m->mnt_fsnotify_marks);
spin_unlock(&mnt->mnt_root->d_lock);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Paris | 69 | 71.13% | 2 | 50.00% |
Jan Kara | 19 | 19.59% | 1 | 25.00% |
Lino Sanfilippo | 9 | 9.28% | 1 | 25.00% |
Total | 97 | 100.00% | 4 | 100.00% |
/*
* given a group and vfsmount, find the mark associated with that combination.
* if found take a reference to that mark and return it, else return NULL
*/
struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group,
struct vfsmount *mnt)
{
struct mount *m = real_mount(mnt);
struct fsnotify_mark *mark;
spin_lock(&mnt->mnt_root->d_lock);
mark = fsnotify_find_mark(&m->mnt_fsnotify_marks, group);
spin_unlock(&mnt->mnt_root->d_lock);
return mark;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Paris | 50 | 74.63% | 1 | 33.33% |
Al Viro | 10 | 14.93% | 1 | 33.33% |
Jan Kara | 7 | 10.45% | 1 | 33.33% |
Total | 67 | 100.00% | 3 | 100.00% |
/*
* Attach an initialized mark to a given group and vfsmount.
* These marks may be used for the fsnotify backend to determine which
* event types should be delivered to which groups.
*/
int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark,
struct fsnotify_group *group, struct vfsmount *mnt,
int allow_dups)
{
struct mount *m = real_mount(mnt);
int ret;
mark->flags |= FSNOTIFY_MARK_FLAG_VFSMOUNT;
BUG_ON(!mutex_is_locked(&group->mark_mutex));
assert_spin_locked(&mark->lock);
spin_lock(&mnt->mnt_root->d_lock);
mark->mnt = mnt;
ret = fsnotify_add_mark_list(&m->mnt_fsnotify_marks, mark, allow_dups);
m->mnt_fsnotify_mask = fsnotify_recalc_mask(&m->mnt_fsnotify_marks);
spin_unlock(&mnt->mnt_root->d_lock);
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Paris | 85 | 72.65% | 3 | 37.50% |
Jan Kara | 11 | 9.40% | 2 | 25.00% |
Al Viro | 10 | 8.55% | 1 | 12.50% |
Lino Sanfilippo | 9 | 7.69% | 1 | 12.50% |
Sasha Levin | 2 | 1.71% | 1 | 12.50% |
Total | 117 | 100.00% | 8 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Paris | 289 | 75.26% | 5 | 45.45% |
Jan Kara | 44 | 11.46% | 2 | 18.18% |
Al Viro | 30 | 7.81% | 1 | 9.09% |
Lino Sanfilippo | 18 | 4.69% | 1 | 9.09% |
Sasha Levin | 2 | 0.52% | 1 | 9.09% |
Arun Sharma | 1 | 0.26% | 1 | 9.09% |
Total | 384 | 100.00% | 11 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.