Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kernel: __rcu annotations

This adds annotations for RCU operations in core kernel components

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

authored by

Arnd Bergmann and committed by
Paul E. McKenney
4d2deb40 d2c2486b

+11 -11
+3 -3
include/linux/fdtable.h
··· 31 31 32 32 struct fdtable { 33 33 unsigned int max_fds; 34 - struct file ** fd; /* current fd array */ 34 + struct file __rcu **fd; /* current fd array */ 35 35 fd_set *close_on_exec; 36 36 fd_set *open_fds; 37 37 struct rcu_head rcu; ··· 46 46 * read mostly part 47 47 */ 48 48 atomic_t count; 49 - struct fdtable *fdt; 49 + struct fdtable __rcu *fdt; 50 50 struct fdtable fdtab; 51 51 /* 52 52 * written part on a separate cache line in SMP ··· 55 55 int next_fd; 56 56 struct embedded_fd_set close_on_exec_init; 57 57 struct embedded_fd_set open_fds_init; 58 - struct file * fd_array[NR_OPEN_DEFAULT]; 58 + struct file __rcu * fd_array[NR_OPEN_DEFAULT]; 59 59 }; 60 60 61 61 #define rcu_dereference_check_fdtable(files, fdtfd) \
+1 -1
include/linux/fs.h
··· 1380 1380 * Saved mount options for lazy filesystems using 1381 1381 * generic_show_options() 1382 1382 */ 1383 - char *s_options; 1383 + char __rcu *s_options; 1384 1384 }; 1385 1385 1386 1386 extern struct timespec current_fs_time(struct super_block *sb);
+3 -3
include/linux/genhd.h
··· 129 129 struct disk_part_tbl { 130 130 struct rcu_head rcu_head; 131 131 int len; 132 - struct hd_struct *last_lookup; 133 - struct hd_struct *part[]; 132 + struct hd_struct __rcu *last_lookup; 133 + struct hd_struct __rcu *part[]; 134 134 }; 135 135 136 136 struct gendisk { ··· 149 149 * non-critical accesses use RCU. Always access through 150 150 * helpers. 151 151 */ 152 - struct disk_part_tbl *part_tbl; 152 + struct disk_part_tbl __rcu *part_tbl; 153 153 struct hd_struct part0; 154 154 155 155 const struct block_device_operations *fops;
+2 -2
include/linux/init_task.h
··· 137 137 .children = LIST_HEAD_INIT(tsk.children), \ 138 138 .sibling = LIST_HEAD_INIT(tsk.sibling), \ 139 139 .group_leader = &tsk, \ 140 - .real_cred = &init_cred, \ 141 - .cred = &init_cred, \ 140 + RCU_INIT_POINTER(.real_cred, &init_cred), \ 141 + RCU_INIT_POINTER(.cred, &init_cred), \ 142 142 .cred_guard_mutex = \ 143 143 __MUTEX_INITIALIZER(tsk.cred_guard_mutex), \ 144 144 .comm = "swapper", \
+1 -1
include/linux/iocontext.h
··· 53 53 54 54 struct radix_tree_root radix_root; 55 55 struct hlist_head cic_list; 56 - void *ioc_data; 56 + void __rcu *ioc_data; 57 57 }; 58 58 59 59 static inline struct io_context *ioc_task_link(struct io_context *ioc)
+1 -1
include/linux/mm_types.h
··· 299 299 * new_owner->mm == mm 300 300 * new_owner->alloc_lock is held 301 301 */ 302 - struct task_struct *owner; 302 + struct task_struct __rcu *owner; 303 303 #endif 304 304 305 305 #ifdef CONFIG_PROC_FS