Commit 3b362157 authored by David Howells's avatar David Howells Committed by Al Viro

VFS: audit: d_backing_inode() annotations

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c1d81b1c
...@@ -1915,7 +1915,7 @@ void audit_log_link_denied(const char *operation, struct path *link) ...@@ -1915,7 +1915,7 @@ void audit_log_link_denied(const char *operation, struct path *link)
/* Generate AUDIT_PATH record with object. */ /* Generate AUDIT_PATH record with object. */
name->type = AUDIT_TYPE_NORMAL; name->type = AUDIT_TYPE_NORMAL;
audit_copy_inode(name, link->dentry, link->dentry->d_inode); audit_copy_inode(name, link->dentry, d_backing_inode(link->dentry));
audit_log_name(current->audit_context, name, link, 0, NULL); audit_log_name(current->audit_context, name, link, 0, NULL);
out: out:
kfree(name); kfree(name);
......
...@@ -576,7 +576,7 @@ int audit_remove_tree_rule(struct audit_krule *rule) ...@@ -576,7 +576,7 @@ int audit_remove_tree_rule(struct audit_krule *rule)
static int compare_root(struct vfsmount *mnt, void *arg) static int compare_root(struct vfsmount *mnt, void *arg)
{ {
return mnt->mnt_root->d_inode == arg; return d_backing_inode(mnt->mnt_root) == arg;
} }
void audit_trim_trees(void) void audit_trim_trees(void)
...@@ -648,7 +648,7 @@ void audit_put_tree(struct audit_tree *tree) ...@@ -648,7 +648,7 @@ void audit_put_tree(struct audit_tree *tree)
static int tag_mount(struct vfsmount *mnt, void *arg) static int tag_mount(struct vfsmount *mnt, void *arg)
{ {
return tag_chunk(mnt->mnt_root->d_inode, arg); return tag_chunk(d_backing_inode(mnt->mnt_root), arg);
} }
/* called with audit_filter_mutex */ /* called with audit_filter_mutex */
......
...@@ -146,7 +146,7 @@ int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev) ...@@ -146,7 +146,7 @@ int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev)
/* Initialize a parent watch entry. */ /* Initialize a parent watch entry. */
static struct audit_parent *audit_init_parent(struct path *path) static struct audit_parent *audit_init_parent(struct path *path)
{ {
struct inode *inode = path->dentry->d_inode; struct inode *inode = d_backing_inode(path->dentry);
struct audit_parent *parent; struct audit_parent *parent;
int ret; int ret;
...@@ -361,11 +361,11 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent) ...@@ -361,11 +361,11 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent)
struct dentry *d = kern_path_locked(watch->path, parent); struct dentry *d = kern_path_locked(watch->path, parent);
if (IS_ERR(d)) if (IS_ERR(d))
return PTR_ERR(d); return PTR_ERR(d);
mutex_unlock(&parent->dentry->d_inode->i_mutex); mutex_unlock(&d_backing_inode(parent->dentry)->i_mutex);
if (d->d_inode) { if (d_is_positive(d)) {
/* update watch filter fields */ /* update watch filter fields */
watch->dev = d->d_inode->i_sb->s_dev; watch->dev = d_backing_inode(d)->i_sb->s_dev;
watch->ino = d->d_inode->i_ino; watch->ino = d_backing_inode(d)->i_ino;
} }
dput(d); dput(d);
return 0; return 0;
...@@ -426,7 +426,7 @@ int audit_add_watch(struct audit_krule *krule, struct list_head **list) ...@@ -426,7 +426,7 @@ int audit_add_watch(struct audit_krule *krule, struct list_head **list)
return ret; return ret;
/* either find an old parent or attach a new one */ /* either find an old parent or attach a new one */
parent = audit_find_parent(parent_path.dentry->d_inode); parent = audit_find_parent(d_backing_inode(parent_path.dentry));
if (!parent) { if (!parent) {
parent = audit_init_parent(&parent_path); parent = audit_init_parent(&parent_path);
if (IS_ERR(parent)) { if (IS_ERR(parent)) {
...@@ -482,7 +482,7 @@ static int audit_watch_handle_event(struct fsnotify_group *group, ...@@ -482,7 +482,7 @@ static int audit_watch_handle_event(struct fsnotify_group *group,
switch (data_type) { switch (data_type) {
case (FSNOTIFY_EVENT_PATH): case (FSNOTIFY_EVENT_PATH):
inode = ((struct path *)data)->dentry->d_inode; inode = d_backing_inode(((struct path *)data)->dentry);
break; break;
case (FSNOTIFY_EVENT_INODE): case (FSNOTIFY_EVENT_INODE):
inode = (struct inode *)data; inode = (struct inode *)data;
......
...@@ -1629,7 +1629,7 @@ static void handle_path(const struct dentry *dentry) ...@@ -1629,7 +1629,7 @@ static void handle_path(const struct dentry *dentry)
rcu_read_lock(); rcu_read_lock();
seq = read_seqbegin(&rename_lock); seq = read_seqbegin(&rename_lock);
for(;;) { for(;;) {
struct inode *inode = d->d_inode; struct inode *inode = d_backing_inode(d);
if (inode && unlikely(!hlist_empty(&inode->i_fsnotify_marks))) { if (inode && unlikely(!hlist_empty(&inode->i_fsnotify_marks))) {
struct audit_chunk *chunk; struct audit_chunk *chunk;
chunk = audit_tree_lookup(inode); chunk = audit_tree_lookup(inode);
...@@ -1754,7 +1754,7 @@ void __audit_inode(struct filename *name, const struct dentry *dentry, ...@@ -1754,7 +1754,7 @@ void __audit_inode(struct filename *name, const struct dentry *dentry,
unsigned int flags) unsigned int flags)
{ {
struct audit_context *context = current->audit_context; struct audit_context *context = current->audit_context;
const struct inode *inode = dentry->d_inode; const struct inode *inode = d_backing_inode(dentry);
struct audit_names *n; struct audit_names *n;
bool parent = flags & AUDIT_INODE_PARENT; bool parent = flags & AUDIT_INODE_PARENT;
...@@ -1853,7 +1853,7 @@ void __audit_inode_child(const struct inode *parent, ...@@ -1853,7 +1853,7 @@ void __audit_inode_child(const struct inode *parent,
const unsigned char type) const unsigned char type)
{ {
struct audit_context *context = current->audit_context; struct audit_context *context = current->audit_context;
const struct inode *inode = dentry->d_inode; const struct inode *inode = d_backing_inode(dentry);
const char *dname = dentry->d_name.name; const char *dname = dentry->d_name.name;
struct audit_names *n, *found_parent = NULL, *found_child = NULL; struct audit_names *n, *found_parent = NULL, *found_child = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment