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

Commit f8206b92 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (23 commits)
  sanitize vfsmount refcounting changes
  fix old umount_tree() breakage
  autofs4: Merge the remaining dentry ops tables
  Unexport do_add_mount() and add in follow_automount(), not ->d_automount()
  Allow d_manage() to be used in RCU-walk mode
  Remove a further kludge from __do_follow_link()
  autofs4: Bump version
  autofs4: Add v4 pseudo direct mount support
  autofs4: Fix wait validation
  autofs4: Clean up autofs4_free_ino()
  autofs4: Clean up dentry operations
  autofs4: Clean up inode operations
  autofs4: Remove unused code
  autofs4: Add d_manage() dentry operation
  autofs4: Add d_automount() dentry operation
  Remove the automount through follow_link() kludge code from pathwalk
  CIFS: Use d_automount() rather than abusing follow_link()
  NFS: Use d_automount() rather than abusing follow_link()
  AFS: Use d_automount() rather than abusing follow_link()
  Add an AT_NO_AUTOMOUNT flag to suppress terminal automount
  ...
parents 1b59be2a f03c6599
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,8 @@ prototypes:
	void (*d_release)(struct dentry *);
	void (*d_release)(struct dentry *);
	void (*d_iput)(struct dentry *, struct inode *);
	void (*d_iput)(struct dentry *, struct inode *);
	char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);
	char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);
	struct vfsmount *(*d_automount)(struct path *path);
	int (*d_manage)(struct dentry *, bool);


locking rules:
locking rules:
		rename_lock	->d_lock	may block	rcu-walk
		rename_lock	->d_lock	may block	rcu-walk
@@ -29,6 +31,8 @@ d_delete: no yes no no
d_release:	no		no		yes		no
d_release:	no		no		yes		no
d_iput:		no		no		yes		no
d_iput:		no		no		yes		no
d_dname:	no		no		no		no
d_dname:	no		no		no		no
d_automount:	no		no		yes		no
d_manage:	no		no		yes (ref-walk)	maybe


--------------------------- inode_operations --------------------------- 
--------------------------- inode_operations --------------------------- 
prototypes:
prototypes:
+43 −0
Original line number Original line Diff line number Diff line
@@ -864,6 +864,8 @@ struct dentry_operations {
	void (*d_release)(struct dentry *);
	void (*d_release)(struct dentry *);
	void (*d_iput)(struct dentry *, struct inode *);
	void (*d_iput)(struct dentry *, struct inode *);
	char *(*d_dname)(struct dentry *, char *, int);
	char *(*d_dname)(struct dentry *, char *, int);
	struct vfsmount *(*d_automount)(struct path *);
	int (*d_manage)(struct dentry *, bool, bool);
};
};


  d_revalidate: called when the VFS needs to revalidate a dentry. This
  d_revalidate: called when the VFS needs to revalidate a dentry. This
@@ -930,6 +932,47 @@ struct dentry_operations {
	at the end of the buffer, and returns a pointer to the first char.
	at the end of the buffer, and returns a pointer to the first char.
	dynamic_dname() helper function is provided to take care of this.
	dynamic_dname() helper function is provided to take care of this.


  d_automount: called when an automount dentry is to be traversed (optional).
	This should create a new VFS mount record and return the record to the
	caller.  The caller is supplied with a path parameter giving the
	automount directory to describe the automount target and the parent
	VFS mount record to provide inheritable mount parameters.  NULL should
	be returned if someone else managed to make the automount first.  If
	the vfsmount creation failed, then an error code should be returned.
	If -EISDIR is returned, then the directory will be treated as an
	ordinary directory and returned to pathwalk to continue walking.

	If a vfsmount is returned, the caller will attempt to mount it on the
	mountpoint and will remove the vfsmount from its expiration list in
	the case of failure.  The vfsmount should be returned with 2 refs on
	it to prevent automatic expiration - the caller will clean up the
	additional ref.

	This function is only used if DCACHE_NEED_AUTOMOUNT is set on the
	dentry.  This is set by __d_instantiate() if S_AUTOMOUNT is set on the
	inode being added.

  d_manage: called to allow the filesystem to manage the transition from a
	dentry (optional).  This allows autofs, for example, to hold up clients
	waiting to explore behind a 'mountpoint' whilst letting the daemon go
	past and construct the subtree there.  0 should be returned to let the
	calling process continue.  -EISDIR can be returned to tell pathwalk to
	use this directory as an ordinary directory and to ignore anything
	mounted on it and not to check the automount flag.  Any other error
	code will abort pathwalk completely.

	If the 'mounting_here' parameter is true, then namespace_sem is being
	held by the caller and the function should not initiate any mounts or
	unmounts that it will then wait for.

	If the 'rcu_walk' parameter is true, then the caller is doing a
	pathwalk in RCU-walk mode.  Sleeping is not permitted in this mode,
	and the caller can be asked to leave it and call again by returing
	-ECHILD.

	This function is only used if DCACHE_MANAGE_TRANSIT is set on the
	dentry being transited from.

Example :
Example :


static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
+1 −1
Original line number Original line Diff line number Diff line
@@ -1201,7 +1201,7 @@ err_unregister_chdev:
static void __exit cleanup_mtdchar(void)
static void __exit cleanup_mtdchar(void)
{
{
	unregister_mtd_user(&mtdchar_notifier);
	unregister_mtd_user(&mtdchar_notifier);
	mntput_long(mtd_inode_mnt);
	mntput(mtd_inode_mnt);
	unregister_filesystem(&mtd_inodefs_type);
	unregister_filesystem(&mtd_inodefs_type);
	__unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd");
	__unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd");
}
}
+2 −3
Original line number Original line Diff line number Diff line
@@ -88,14 +88,13 @@ struct autofs_dir_ent *autofs_expire(struct super_block *sb,
		}
		}
		path.mnt = mnt;
		path.mnt = mnt;
		path_get(&path);
		path_get(&path);
		if (!follow_down(&path)) {
		if (!follow_down_one(&path)) {
			path_put(&path);
			path_put(&path);
			DPRINTK(("autofs: not expirable\
			DPRINTK(("autofs: not expirable\
			(not a mounted directory): %s\n", ent->name));
			(not a mounted directory): %s\n", ent->name));
			continue;
			continue;
		}
		}
		while (d_mountpoint(path.dentry) && follow_down(&path))
		follow_down(&path, false);  // TODO: need to check error
			;
		umount_ok = may_umount(path.mnt);
		umount_ok = may_umount(path.mnt);
		path_put(&path);
		path_put(&path);


+1 −0
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ const struct dentry_operations afs_fs_dentry_operations = {
	.d_revalidate	= afs_d_revalidate,
	.d_revalidate	= afs_d_revalidate,
	.d_delete	= afs_d_delete,
	.d_delete	= afs_d_delete,
	.d_release	= afs_d_release,
	.d_release	= afs_d_release,
	.d_automount	= afs_d_automount,
};
};


#define AFS_DIR_HASHTBL_SIZE	128
#define AFS_DIR_HASHTBL_SIZE	128
Loading