diff options
-rw-r--r-- | fs/file.c | 3 | ||||
-rw-r--r-- | fs/fs-writeback.c | 31 | ||||
-rw-r--r-- | fs/partitions/check.c | 1 |
3 files changed, 26 insertions, 9 deletions
@@ -178,7 +178,6 @@ static struct fdtable * alloc_fdtable(unsigned int nr) | |||
178 | fdt->open_fds = (fd_set *)data; | 178 | fdt->open_fds = (fd_set *)data; |
179 | data += nr / BITS_PER_BYTE; | 179 | data += nr / BITS_PER_BYTE; |
180 | fdt->close_on_exec = (fd_set *)data; | 180 | fdt->close_on_exec = (fd_set *)data; |
181 | INIT_RCU_HEAD(&fdt->rcu); | ||
182 | fdt->next = NULL; | 181 | fdt->next = NULL; |
183 | 182 | ||
184 | return fdt; | 183 | return fdt; |
@@ -312,7 +311,6 @@ struct files_struct *dup_fd(struct files_struct *oldf, int *errorp) | |||
312 | new_fdt->close_on_exec = (fd_set *)&newf->close_on_exec_init; | 311 | new_fdt->close_on_exec = (fd_set *)&newf->close_on_exec_init; |
313 | new_fdt->open_fds = (fd_set *)&newf->open_fds_init; | 312 | new_fdt->open_fds = (fd_set *)&newf->open_fds_init; |
314 | new_fdt->fd = &newf->fd_array[0]; | 313 | new_fdt->fd = &newf->fd_array[0]; |
315 | INIT_RCU_HEAD(&new_fdt->rcu); | ||
316 | new_fdt->next = NULL; | 314 | new_fdt->next = NULL; |
317 | 315 | ||
318 | spin_lock(&oldf->file_lock); | 316 | spin_lock(&oldf->file_lock); |
@@ -430,7 +428,6 @@ struct files_struct init_files = { | |||
430 | .fd = &init_files.fd_array[0], | 428 | .fd = &init_files.fd_array[0], |
431 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, | 429 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, |
432 | .open_fds = (fd_set *)&init_files.open_fds_init, | 430 | .open_fds = (fd_set *)&init_files.open_fds_init, |
433 | .rcu = RCU_HEAD_INIT, | ||
434 | }, | 431 | }, |
435 | .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), | 432 | .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), |
436 | }; | 433 | }; |
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 1d1088f48bc2..af92100a7411 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -75,12 +75,33 @@ static inline bool bdi_work_on_stack(struct bdi_work *work) | |||
75 | return test_bit(WS_ONSTACK_B, &work->state); | 75 | return test_bit(WS_ONSTACK_B, &work->state); |
76 | } | 76 | } |
77 | 77 | ||
78 | static inline void bdi_work_init(struct bdi_work *work, | 78 | static inline void __bdi_work_init(struct bdi_work *work, |
79 | struct wb_writeback_args *args) | 79 | struct wb_writeback_args *args, |
80 | int on_stack) | ||
80 | { | 81 | { |
81 | INIT_RCU_HEAD(&work->rcu_head); | ||
82 | work->args = *args; | 82 | work->args = *args; |
83 | work->state = WS_USED; | 83 | work->state = WS_USED; |
84 | if (on_stack) { | ||
85 | work->state |= WS_ONSTACK; | ||
86 | init_rcu_head_on_stack(&work->rcu_head); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | static inline void bdi_work_init(struct bdi_work *work, | ||
91 | struct wb_writeback_args *args) | ||
92 | { | ||
93 | __bdi_work_init(work, args, false); | ||
94 | } | ||
95 | |||
96 | static inline void bdi_work_init_on_stack(struct bdi_work *work, | ||
97 | struct wb_writeback_args *args) | ||
98 | { | ||
99 | __bdi_work_init(work, args, true); | ||
100 | } | ||
101 | |||
102 | static inline void bdi_destroy_work_on_stack(struct bdi_work *work) | ||
103 | { | ||
104 | destroy_rcu_head_on_stack(&work->rcu_head); | ||
84 | } | 105 | } |
85 | 106 | ||
86 | /** | 107 | /** |
@@ -233,11 +254,11 @@ static void bdi_sync_writeback(struct backing_dev_info *bdi, | |||
233 | }; | 254 | }; |
234 | struct bdi_work work; | 255 | struct bdi_work work; |
235 | 256 | ||
236 | bdi_work_init(&work, &args); | 257 | bdi_work_init_on_stack(&work, &args); |
237 | work.state |= WS_ONSTACK; | ||
238 | 258 | ||
239 | bdi_queue_work(bdi, &work); | 259 | bdi_queue_work(bdi, &work); |
240 | bdi_wait_on_work_clear(&work); | 260 | bdi_wait_on_work_clear(&work); |
261 | bdi_destroy_work_on_stack(&work); | ||
241 | } | 262 | } |
242 | 263 | ||
243 | /** | 264 | /** |
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 5dcd4b0c5533..72c52656dc2e 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -459,7 +459,6 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, | |||
459 | } | 459 | } |
460 | 460 | ||
461 | /* everything is up and running, commence */ | 461 | /* everything is up and running, commence */ |
462 | INIT_RCU_HEAD(&p->rcu_head); | ||
463 | rcu_assign_pointer(ptbl->part[partno], p); | 462 | rcu_assign_pointer(ptbl->part[partno], p); |
464 | 463 | ||
465 | /* suppress uevent if the disk supresses it */ | 464 | /* suppress uevent if the disk supresses it */ |