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

Commit b8a327be authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-pull

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-pull: (64 commits)
  [XFS] Remove vn_revalidate calls in xfs.
  [XFS] Now that xfs_setattr is only used for attributes set from ->setattr
  [XFS] xfs_setattr currently doesn't just handle the attributes set through
  [XFS] fix use after free with external logs or real-time devices
  [XFS] A bug was found in xfs_bmap_add_extent_unwritten_real(). In a
  [XFS] fix compilation without CONFIG_PROC_FS
  [XFS] s/XFS_PURGE_INODE/IRELE/g s/VN_HOLD(XFS_ITOV())/IHOLD()/
  [XFS] fix mount option parsing in remount
  [XFS] Disable queue flag test in barrier check.
  [XFS] streamline init/exit path
  [XFS] Fix up problem when CONFIG_XFS_POSIX_ACL is not set and yet we still
  [XFS] Don't assert if trying to mount with blocksize > pagesize
  [XFS] Don't update mtime on rename source
  [XFS] Allow xfs_bmbt_split() to fallback to the lowspace allocator
  [XFS] Restore the lowspace extent allocator algorithm
  [XFS] use minleft when allocating in xfs_bmbt_split()
  [XFS] attrmulti cleanup
  [XFS] Check for invalid flags in xfs_attrlist_by_handle.
  [XFS] Fix CI lookup in leaf-form directories
  [XFS] Use the generic xattr methods.
  ...
parents 46bd58ea f13fae2d
Loading
Loading
Loading
Loading
+102 −0
Original line number Diff line number Diff line
@@ -1220,6 +1220,107 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
	return new;
}

/**
 * d_add_ci - lookup or allocate new dentry with case-exact name
 * @inode:  the inode case-insensitive lookup has found
 * @dentry: the negative dentry that was passed to the parent's lookup func
 * @name:   the case-exact name to be associated with the returned dentry
 *
 * This is to avoid filling the dcache with case-insensitive names to the
 * same inode, only the actual correct case is stored in the dcache for
 * case-insensitive filesystems.
 *
 * For a case-insensitive lookup match and if the the case-exact dentry
 * already exists in in the dcache, use it and return it.
 *
 * If no entry exists with the exact case name, allocate new dentry with
 * the exact case, and return the spliced entry.
 */
struct dentry *d_add_ci(struct inode *inode, struct dentry *dentry,
			struct qstr *name)
{
	int error;
	struct dentry *found;
	struct dentry *new;

	/* Does a dentry matching the name exist already? */
	found = d_hash_and_lookup(dentry->d_parent, name);
	/* If not, create it now and return */
	if (!found) {
		new = d_alloc(dentry->d_parent, name);
		if (!new) {
			error = -ENOMEM;
			goto err_out;
		}
		found = d_splice_alias(inode, new);
		if (found) {
			dput(new);
			return found;
		}
		return new;
	}
	/* Matching dentry exists, check if it is negative. */
	if (found->d_inode) {
		if (unlikely(found->d_inode != inode)) {
			/* This can't happen because bad inodes are unhashed. */
			BUG_ON(!is_bad_inode(inode));
			BUG_ON(!is_bad_inode(found->d_inode));
		}
		/*
		 * Already have the inode and the dentry attached, decrement
		 * the reference count to balance the iget() done
		 * earlier on.  We found the dentry using d_lookup() so it
		 * cannot be disconnected and thus we do not need to worry
		 * about any NFS/disconnectedness issues here.
		 */
		iput(inode);
		return found;
	}
	/*
	 * Negative dentry: instantiate it unless the inode is a directory and
	 * has a 'disconnected' dentry (i.e. IS_ROOT and DCACHE_DISCONNECTED),
	 * in which case d_move() that in place of the found dentry.
	 */
	if (!S_ISDIR(inode->i_mode)) {
		/* Not a directory; everything is easy. */
		d_instantiate(found, inode);
		return found;
	}
	spin_lock(&dcache_lock);
	if (list_empty(&inode->i_dentry)) {
		/*
		 * Directory without a 'disconnected' dentry; we need to do
		 * d_instantiate() by hand because it takes dcache_lock which
		 * we already hold.
		 */
		list_add(&found->d_alias, &inode->i_dentry);
		found->d_inode = inode;
		spin_unlock(&dcache_lock);
		security_d_instantiate(found, inode);
		return found;
	}
	/*
	 * Directory with a 'disconnected' dentry; get a reference to the
	 * 'disconnected' dentry.
	 */
	new = list_entry(inode->i_dentry.next, struct dentry, d_alias);
	dget_locked(new);
	spin_unlock(&dcache_lock);
	/* Do security vodoo. */
	security_d_instantiate(found, inode);
	/* Move new in place of found. */
	d_move(new, found);
	/* Balance the iget() we did above. */
	iput(inode);
	/* Throw away found. */
	dput(found);
	/* Use new as the actual dentry. */
	return new;

err_out:
	iput(inode);
	return ERR_PTR(error);
}

/**
 * d_lookup - search for a dentry
@@ -2254,6 +2355,7 @@ EXPORT_SYMBOL(d_path);
EXPORT_SYMBOL(d_prune_aliases);
EXPORT_SYMBOL(d_rehash);
EXPORT_SYMBOL(d_splice_alias);
EXPORT_SYMBOL(d_add_ci);
EXPORT_SYMBOL(d_validate);
EXPORT_SYMBOL(dget_locked);
EXPORT_SYMBOL(dput);
+2 −1
Original line number Diff line number Diff line
@@ -106,7 +106,8 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \
				   xfs_iops.o \
				   xfs_lrw.o \
				   xfs_super.o \
				   xfs_vnode.o)
				   xfs_vnode.o \
				   xfs_xattr.o)

# Objects in support/
xfs-y				+= $(addprefix support/, \
+3 −3
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize,
}

void
kmem_free(void *ptr, size_t size)
kmem_free(const void *ptr)
{
	if (!is_vmalloc_addr(ptr)) {
		kfree(ptr);
@@ -100,7 +100,7 @@ kmem_free(void *ptr, size_t size)
}

void *
kmem_realloc(void *ptr, size_t newsize, size_t oldsize,
kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
	     unsigned int __nocast flags)
{
	void	*new;
@@ -110,7 +110,7 @@ kmem_realloc(void *ptr, size_t newsize, size_t oldsize,
		if (new)
			memcpy(new, ptr,
				((oldsize < newsize) ? oldsize : newsize));
		kmem_free(ptr, oldsize);
		kmem_free(ptr);
	}
	return new;
}
+2 −2
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ kmem_flags_convert(unsigned int __nocast flags)
extern void *kmem_alloc(size_t, unsigned int __nocast);
extern void *kmem_zalloc(size_t, unsigned int __nocast);
extern void *kmem_zalloc_greedy(size_t *, size_t, size_t, unsigned int __nocast);
extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast);
extern void  kmem_free(void *, size_t);
extern void *kmem_realloc(const void *, size_t, size_t, unsigned int __nocast);
extern void  kmem_free(const void *);

/*
 * Zone interfaces
+2 −3
Original line number Diff line number Diff line
@@ -409,7 +409,6 @@ xfs_start_buffer_writeback(
STATIC void
xfs_start_page_writeback(
	struct page		*page,
	struct writeback_control *wbc,
	int			clear_dirty,
	int			buffers)
{
@@ -858,7 +857,7 @@ xfs_convert_page(
				done = 1;
			}
		}
		xfs_start_page_writeback(page, wbc, !page_dirty, count);
		xfs_start_page_writeback(page, !page_dirty, count);
	}

	return done;
@@ -1130,7 +1129,7 @@ xfs_page_state_convert(
		SetPageUptodate(page);

	if (startio)
		xfs_start_page_writeback(page, wbc, 1, count);
		xfs_start_page_writeback(page, 1, count);

	if (ioend && iomap_valid) {
		offset = (iomap.iomap_offset + iomap.iomap_bsize - 1) >>
Loading