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

Commit 7682c918 authored by David Howells's avatar David Howells Committed by Al Viro
Browse files

VFS: kernel/: d_inode() annotations



relayfs and tracefs are dealing with inodes of their own;
those two act as filesystem drivers

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3b362157
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -407,7 +407,7 @@ static inline void relay_set_buf_dentry(struct rchan_buf *buf,
					struct dentry *dentry)
					struct dentry *dentry)
{
{
	buf->dentry = dentry;
	buf->dentry = dentry;
	buf->dentry->d_inode->i_size = buf->early_bytes;
	d_inode(buf->dentry)->i_size = buf->early_bytes;
}
}


static struct dentry *relay_create_buf_file(struct rchan *chan,
static struct dentry *relay_create_buf_file(struct rchan *chan,
@@ -733,7 +733,7 @@ size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length)
		buf->padding[old_subbuf] = buf->prev_padding;
		buf->padding[old_subbuf] = buf->prev_padding;
		buf->subbufs_produced++;
		buf->subbufs_produced++;
		if (buf->dentry)
		if (buf->dentry)
			buf->dentry->d_inode->i_size +=
			d_inode(buf->dentry)->i_size +=
				buf->chan->subbuf_size -
				buf->chan->subbuf_size -
				buf->padding[old_subbuf];
				buf->padding[old_subbuf];
		else
		else
+4 −4
Original line number Original line Diff line number Diff line
@@ -5846,7 +5846,7 @@ trace_create_cpu_file(const char *name, umode_t mode, struct dentry *parent,
	struct dentry *ret = trace_create_file(name, mode, parent, data, fops);
	struct dentry *ret = trace_create_file(name, mode, parent, data, fops);


	if (ret) /* See tracing_get_cpu() */
	if (ret) /* See tracing_get_cpu() */
		ret->d_inode->i_cdev = (void *)(cpu + 1);
		d_inode(ret)->i_cdev = (void *)(cpu + 1);
	return ret;
	return ret;
}
}


@@ -6420,7 +6420,7 @@ static int instance_rmdir(struct inode *inode, struct dentry *dentry)
		return -ENOENT;
		return -ENOENT;


	/* The caller did a dget() on dentry */
	/* The caller did a dget() on dentry */
	mutex_unlock(&dentry->d_inode->i_mutex);
	mutex_unlock(&d_inode(dentry)->i_mutex);


	/*
	/*
	 * The inode mutex is locked, but debugfs_create_dir() will also
	 * The inode mutex is locked, but debugfs_create_dir() will also
@@ -6435,7 +6435,7 @@ static int instance_rmdir(struct inode *inode, struct dentry *dentry)
	ret = instance_delete(dentry->d_iname);
	ret = instance_delete(dentry->d_iname);


	mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT);
	mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT);
	mutex_lock(&dentry->d_inode->i_mutex);
	mutex_lock(&d_inode(dentry)->i_mutex);


	return ret;
	return ret;
}
}
@@ -6453,7 +6453,7 @@ static __init void create_trace_instances(struct dentry *d_tracer)
		return;
		return;


	/* Hijack the dir inode operations, to allow mkdir */
	/* Hijack the dir inode operations, to allow mkdir */
	trace_instance_dir->d_inode->i_op = &instance_dir_inode_operations;
	d_inode(trace_instance_dir)->i_op = &instance_dir_inode_operations;
}
}


static void
static void
+2 −2
Original line number Original line Diff line number Diff line
@@ -494,8 +494,8 @@ static void remove_event_file_dir(struct ftrace_event_file *file)
	if (dir) {
	if (dir) {
		spin_lock(&dir->d_lock);	/* probably unneeded */
		spin_lock(&dir->d_lock);	/* probably unneeded */
		list_for_each_entry(child, &dir->d_subdirs, d_child) {
		list_for_each_entry(child, &dir->d_subdirs, d_child) {
			if (child->d_inode)	/* probably unneeded */
			if (d_really_is_positive(child))	/* probably unneeded */
				child->d_inode->i_private = NULL;
				d_inode(child)->i_private = NULL;
		}
		}
		spin_unlock(&dir->d_lock);
		spin_unlock(&dir->d_lock);


+1 −1
Original line number Original line Diff line number Diff line
@@ -443,7 +443,7 @@ static int create_trace_uprobe(int argc, char **argv)
	if (ret)
	if (ret)
		goto fail_address_parse;
		goto fail_address_parse;


	inode = igrab(path.dentry->d_inode);
	inode = igrab(d_inode(path.dentry));
	path_put(&path);
	path_put(&path);


	if (!inode || !S_ISREG(inode->i_mode)) {
	if (!inode || !S_ISREG(inode->i_mode)) {