md/bitmap: remove rcu annotation from pointer arithmetic.
[deliverable/linux.git] / drivers / md / bitmap.c
index e98db04eb4f9b108973d003db355895d00dbfc2c..135a0907e9de413d140e9fb9b793a91b638a1606 100644 (file)
@@ -177,11 +177,16 @@ static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mdde
         * nr_pending is 0 and In_sync is clear, the entries we return will
         * still be in the same position on the list when we re-enter
         * list_for_each_entry_continue_rcu.
+        *
+        * Note that if entered with 'rdev == NULL' to start at the
+        * beginning, we temporarily assign 'rdev' to an address which
+        * isn't really an rdev, but which can be used by
+        * list_for_each_entry_continue_rcu() to find the first entry.
         */
        rcu_read_lock();
        if (rdev == NULL)
                /* start at the beginning */
-               rdev = list_entry_rcu(&mddev->disks, struct md_rdev, same_set);
+               rdev = list_entry(&mddev->disks, struct md_rdev, same_set);
        else {
                /* release the previous rdev and start from there. */
                rdev_dec_pending(rdev, mddev);
@@ -1851,7 +1856,7 @@ EXPORT_SYMBOL_GPL(bitmap_load);
  * to our bitmap
  */
 int bitmap_copy_from_slot(struct mddev *mddev, int slot,
-               sector_t *low, sector_t *high)
+               sector_t *low, sector_t *high, bool clear_bits)
 {
        int rv = 0, i, j;
        sector_t block, lo = 0, hi = 0;
@@ -1882,14 +1887,16 @@ int bitmap_copy_from_slot(struct mddev *mddev, int slot,
                }
        }
 
-       bitmap_update_sb(bitmap);
-       /* Setting this for the ev_page should be enough.
-        * And we do not require both write_all and PAGE_DIRT either
-        */
-       for (i = 0; i < bitmap->storage.file_pages; i++)
-               set_page_attr(bitmap, i, BITMAP_PAGE_DIRTY);
-       bitmap_write_all(bitmap);
-       bitmap_unplug(bitmap);
+       if (clear_bits) {
+               bitmap_update_sb(bitmap);
+               /* Setting this for the ev_page should be enough.
+                * And we do not require both write_all and PAGE_DIRT either
+                */
+               for (i = 0; i < bitmap->storage.file_pages; i++)
+                       set_page_attr(bitmap, i, BITMAP_PAGE_DIRTY);
+               bitmap_write_all(bitmap);
+               bitmap_unplug(bitmap);
+       }
        *low = lo;
        *high = hi;
 err:
This page took 0.051649 seconds and 5 git commands to generate.