Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2504c5d6 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Eric Paris
Browse files

fsnotify/vfsmount: add fsnotify fields to struct vfsmount



This patch adds the list and mask fields needed to support vfsmount marks.
These are the same fields fsnotify needs on an inode.  They are not used,
just declared and we note where the cleanup hook should be (the function is
not yet defined)

Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent ba643f04
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@
#include <linux/log2.h>
#include <linux/log2.h>
#include <linux/idr.h>
#include <linux/idr.h>
#include <linux/fs_struct.h>
#include <linux/fs_struct.h>
#include <linux/fsnotify.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include <asm/unistd.h>
#include "pnode.h"
#include "pnode.h"
@@ -150,6 +151,9 @@ struct vfsmount *alloc_vfsmnt(const char *name)
		INIT_LIST_HEAD(&mnt->mnt_share);
		INIT_LIST_HEAD(&mnt->mnt_share);
		INIT_LIST_HEAD(&mnt->mnt_slave_list);
		INIT_LIST_HEAD(&mnt->mnt_slave_list);
		INIT_LIST_HEAD(&mnt->mnt_slave);
		INIT_LIST_HEAD(&mnt->mnt_slave);
#ifdef CONFIG_FSNOTIFY
		INIT_HLIST_HEAD(&mnt->mnt_fsnotify_marks);
#endif
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
		mnt->mnt_writers = alloc_percpu(int);
		mnt->mnt_writers = alloc_percpu(int);
		if (!mnt->mnt_writers)
		if (!mnt->mnt_writers)
+1 −3
Original line number Original line Diff line number Diff line
@@ -163,9 +163,7 @@ static bool needed_by_vfsmount(__u32 test_mask, struct vfsmount *mnt)
	if (!mnt)
	if (!mnt)
		return false;
		return false;


	/* hook in this when mnt->mnt_fsnotify_mask is defined */
	return (test_mask & mnt->mnt_fsnotify_mask);
	/* return (test_mask & path->mnt->mnt_fsnotify_mask); */
	return false;
}
}
/*
/*
 * This is the main call to fsnotify.  The VFS calls into hook specific functions
 * This is the main call to fsnotify.  The VFS calls into hook specific functions
+5 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,11 @@ struct vfsmount {
	struct list_head mnt_mounts;	/* list of children, anchored here */
	struct list_head mnt_mounts;	/* list of children, anchored here */
	struct list_head mnt_child;	/* and going through their mnt_child */
	struct list_head mnt_child;	/* and going through their mnt_child */
	int mnt_flags;
	int mnt_flags;
	/* 4 bytes hole on 64bits arches */
	/* 4 bytes hole on 64bits arches without fsnotify */
#ifdef CONFIG_FSNOTIFY
	__u32 mnt_fsnotify_mask;
	struct hlist_head mnt_fsnotify_marks;
#endif
	const char *mnt_devname;	/* Name of device e.g. /dev/dsk/hda1 */
	const char *mnt_devname;	/* Name of device e.g. /dev/dsk/hda1 */
	struct list_head mnt_list;
	struct list_head mnt_list;
	struct list_head mnt_expire;	/* link in fs-specific expiry list */
	struct list_head mnt_expire;	/* link in fs-specific expiry list */