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

Commit d895cb1a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull vfs pile (part one) from Al Viro:
 "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent
  locking violations, etc.

  The most visible changes here are death of FS_REVAL_DOT (replaced with
  "has ->d_weak_revalidate()") and a new helper getting from struct file
  to inode.  Some bits of preparation to xattr method interface changes.

  Misc patches by various people sent this cycle *and* ocfs2 fixes from
  several cycles ago that should've been upstream right then.

  PS: the next vfs pile will be xattr stuff."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
  saner proc_get_inode() calling conventions
  proc: avoid extra pde_put() in proc_fill_super()
  fs: change return values from -EACCES to -EPERM
  fs/exec.c: make bprm_mm_init() static
  ocfs2/dlm: use GFP_ATOMIC inside a spin_lock
  ocfs2: fix possible use-after-free with AIO
  ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path
  get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero
  target: writev() on single-element vector is pointless
  export kernel_write(), convert open-coded instances
  fs: encode_fh: return FILEID_INVALID if invalid fid_type
  kill f_vfsmnt
  vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
  nfsd: handle vfs_getattr errors in acl protocol
  switch vfs_getattr() to struct path
  default SET_PERSONALITY() in linux/elf.h
  ceph: prepopulate inodes only when request is aborted
  d_hash_and_lookup(): export, switch open-coded instances
  9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()
  9p: split dropping the acls from v9fs_set_create_acl()
  ...
parents 96263573 d3d009cb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ be able to use diff(1).
--------------------------- dentry_operations --------------------------
prototypes:
	int (*d_revalidate)(struct dentry *, unsigned int);
	int (*d_weak_revalidate)(struct dentry *, unsigned int);
	int (*d_hash)(const struct dentry *, const struct inode *,
			struct qstr *);
	int (*d_compare)(const struct dentry *, const struct inode *,
@@ -25,6 +26,7 @@ prototypes:
locking rules:
		rename_lock	->d_lock	may block	rcu-walk
d_revalidate:	no		no		yes (ref-walk)	maybe
d_weak_revalidate:no		no		yes	 	no
d_hash		no		no		no		maybe
d_compare:	yes		no		no		maybe
d_delete:	no		yes		no		no
+4 −0
Original line number Diff line number Diff line
@@ -441,3 +441,7 @@ d_make_root() drops the reference to inode if dentry allocation fails.
two, it gets "is it an O_EXCL or equivalent?" boolean argument.  Note that
local filesystems can ignore tha argument - they are guaranteed that the
object doesn't exist.  It's remote/distributed ones that might care...
--
[mandatory]
	FS_REVAL_DOT is gone; if you used to have it, add ->d_weak_revalidate()
in your dentry operations instead.
+22 −2
Original line number Diff line number Diff line
@@ -900,6 +900,7 @@ defined:

struct dentry_operations {
	int (*d_revalidate)(struct dentry *, unsigned int);
	int (*d_weak_revalidate)(struct dentry *, unsigned int);
	int (*d_hash)(const struct dentry *, const struct inode *,
			struct qstr *);
	int (*d_compare)(const struct dentry *, const struct inode *,
@@ -915,8 +916,13 @@ struct dentry_operations {

  d_revalidate: called when the VFS needs to revalidate a dentry. This
	is called whenever a name look-up finds a dentry in the
	dcache. Most filesystems leave this as NULL, because all their
	dentries in the dcache are valid
	dcache. Most local filesystems leave this as NULL, because all their
	dentries in the dcache are valid. Network filesystems are different
	since things can change on the server without the client necessarily
	being aware of it.

	This function should return a positive value if the dentry is still
	valid, and zero or a negative error code if it isn't.

	d_revalidate may be called in rcu-walk mode (flags & LOOKUP_RCU).
	If in rcu-walk mode, the filesystem must revalidate the dentry without
@@ -927,6 +933,20 @@ struct dentry_operations {
	If a situation is encountered that rcu-walk cannot handle, return
	-ECHILD and it will be called again in ref-walk mode.

 d_weak_revalidate: called when the VFS needs to revalidate a "jumped" dentry.
	This is called when a path-walk ends at dentry that was not acquired by
	doing a lookup in the parent directory. This includes "/", "." and "..",
	as well as procfs-style symlinks and mountpoint traversal.

	In this case, we are less concerned with whether the dentry is still
	fully correct, but rather that the inode is still valid. As with
	d_revalidate, most local filesystems will set this to NULL since their
	dcache entries are always valid.

	This function has the same return code semantics as d_revalidate.

	d_weak_revalidate is only called after leaving rcu-walk mode.

  d_hash: called when the VFS adds a dentry to the hash table. The first
	dentry passed to d_hash is the parent directory that the name is
	to be hashed into. The inode is the dentry's inode.
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
				  size_t count, loff_t *pos)
{
	int res;
	srm_env_t	*entry = PDE(file->f_path.dentry->d_inode)->data;
	srm_env_t	*entry = PDE(file_inode(file))->data;
	char		*buf = (char *) __get_free_page(GFP_USER);
	unsigned long	ret1, ret2;

+0 −3
Original line number Diff line number Diff line
@@ -102,7 +102,4 @@ typedef struct user_fpu_struct elf_fpregset_t;

#define ELF_PLATFORM  (NULL)

#define SET_PERSONALITY(ex) \
	set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))

#endif /* __ASM_AVR32_ELF_H */
Loading