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

Commit dc3f4198 authored by Al Viro's avatar Al Viro
Browse files

make simple_positive() public



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5d754ced
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static void spufs_prune_dir(struct dentry *dir)
	mutex_lock(&d_inode(dir)->i_mutex);
	list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
		spin_lock(&dentry->d_lock);
		if (!(d_unhashed(dentry)) && d_really_is_positive(dentry)) {
		if (simple_positive(dentry)) {
			dget_dlock(dentry);
			__d_drop(dentry);
			spin_unlock(&dentry->d_lock);
+1 −6
Original line number Diff line number Diff line
@@ -62,18 +62,13 @@ static void hypfs_add_dentry(struct dentry *dentry)
	hypfs_last_dentry = dentry;
}

static inline int hypfs_positive(struct dentry *dentry)
{
	return d_really_is_positive(dentry) && !d_unhashed(dentry);
}

static void hypfs_remove(struct dentry *dentry)
{
	struct dentry *parent;

	parent = dentry->d_parent;
	mutex_lock(&d_inode(parent)->i_mutex);
	if (hypfs_positive(dentry)) {
	if (simple_positive(dentry)) {
		if (d_is_dir(dentry))
			simple_rmdir(d_inode(parent), dentry);
		else
+1 −9
Original line number Diff line number Diff line
@@ -419,14 +419,6 @@ static int in_flight_summary_show(struct seq_file *m, void *pos)
	return 0;
}

/* simple_positive(file->f_path.dentry) respectively debugfs_positive(),
 * but neither is "reachable" from here.
 * So we have our own inline version of it above.  :-( */
static inline int debugfs_positive(struct dentry *dentry)
{
        return d_really_is_positive(dentry) && !d_unhashed(dentry);
}

/* make sure at *open* time that the respective object won't go away. */
static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, void *),
		                void *data, struct kref *kref,
@@ -444,7 +436,7 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
	/* serialize with d_delete() */
	mutex_lock(&d_inode(parent)->i_mutex);
	/* Make sure the object is still alive */
	if (debugfs_positive(file->f_path.dentry)
	if (simple_positive(file->f_path.dentry)
	&& kref_get_unless_zero(kref))
		ret = 0;
	mutex_unlock(&d_inode(parent)->i_mutex);
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ static int remove_file(struct dentry *parent, char *name)
	}

	spin_lock(&tmp->d_lock);
	if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
	if (simple_positive(tmp)) {
		dget_dlock(tmp);
		__d_drop(tmp);
		spin_unlock(&tmp->d_lock);
+1 −1
Original line number Diff line number Diff line
@@ -455,7 +455,7 @@ static int remove_file(struct dentry *parent, char *name)
	}

	spin_lock(&tmp->d_lock);
	if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
	if (simple_positive(tmp)) {
		__d_drop(tmp);
		spin_unlock(&tmp->d_lock);
		simple_unlink(d_inode(parent), tmp);
Loading