fuse: copy_file_range should truncate cache
[linux-2.6-microblaze.git] / kernel / audit_fsnotify.c
index f0d2433..3596448 100644 (file)
@@ -160,23 +160,14 @@ static int audit_mark_handle_event(struct fsnotify_group *group,
 {
        struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info);
        struct audit_fsnotify_mark *audit_mark;
-       const struct inode *inode = NULL;
+       const struct inode *inode = fsnotify_data_inode(data, data_type);
 
        audit_mark = container_of(inode_mark, struct audit_fsnotify_mark, mark);
 
        BUG_ON(group != audit_fsnotify_group);
 
-       switch (data_type) {
-       case (FSNOTIFY_EVENT_PATH):
-               inode = ((const struct path *)data)->dentry->d_inode;
-               break;
-       case (FSNOTIFY_EVENT_INODE):
-               inode = (const struct inode *)data;
-               break;
-       default:
-               BUG();
+       if (WARN_ON(!inode))
                return 0;
-       }
 
        if (mask & (FS_CREATE|FS_MOVED_TO|FS_DELETE|FS_MOVED_FROM)) {
                if (audit_compare_dname_path(dname, audit_mark->path, AUDIT_NAME_FULL))