]> Git Repo - linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
authorLinus Torvalds <[email protected]>
Fri, 10 Oct 2008 18:11:47 +0000 (11:11 -0700)
committerLinus Torvalds <[email protected]>
Fri, 10 Oct 2008 18:11:47 +0000 (11:11 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm: detect lost queue
  dm: publish dm_vcalloc
  dm: publish dm_table_unplug_all
  dm: publish dm_get_mapinfo
  dm: export struct dm_dev
  dm crypt: avoid unnecessary wait when splitting bio
  dm crypt: tidy ctx pending
  dm crypt: fix async inc_pending
  dm crypt: move dec_pending on error into write_io_submit
  dm crypt: remove inc_pending from write_io_submit
  dm crypt: tidy write loop pending
  dm crypt: tidy crypt alloc
  dm crypt: tidy inc pending
  dm exception store: use chunk_t for_areas
  dm exception store: introduce area_location function
  dm raid1: kcopyd should stop on error if errors handled
  dm mpath: remove is_active from struct dm_path
  dm mpath: use more error codes

Fixed up trivial conflict in drivers/md/dm-mpath.c manually.

1  2 
drivers/md/dm-ioctl.c
drivers/md/dm-mpath.c

diff --combined drivers/md/dm-ioctl.c
index 5b919159f084901b0b4b29d1797eb8144b7ba0ba,90e19f13f26986c2f0b6b3e3177eaf77bb1ababb..dca401dc70a0ec3f24c0392851a002a8a125fd21
@@@ -426,7 -426,7 +426,7 @@@ static int list_devices(struct dm_ioct
                                old_nl->next = (uint32_t) ((void *) nl -
                                                           (void *) old_nl);
                        disk = dm_disk(hc->md);
 -                      nl->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor));
 +                      nl->dev = huge_encode_dev(disk_devt(disk));
                        nl->next = 0;
                        strcpy(nl->name, hc->name);
  
@@@ -539,7 -539,7 +539,7 @@@ static int __dev_status(struct mapped_d
        if (dm_suspended(md))
                param->flags |= DM_SUSPEND_FLAG;
  
 -      param->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor));
 +      param->dev = huge_encode_dev(disk_devt(disk));
  
        /*
         * Yes, this will be out of date by the time it gets back
         */
        param->open_count = dm_open_count(md);
  
 -      if (disk->policy)
 +      if (get_disk_ro(disk))
                param->flags |= DM_READONLY_FLAG;
  
        param->event_nr = dm_get_event_nr(md);
@@@ -1131,7 -1131,7 +1131,7 @@@ static void retrieve_deps(struct dm_tab
        unsigned int count = 0;
        struct list_head *tmp;
        size_t len, needed;
-       struct dm_dev *dd;
+       struct dm_dev_internal *dd;
        struct dm_target_deps *deps;
  
        deps = get_result_buffer(param, param_size, &len);
        deps->count = count;
        count = 0;
        list_for_each_entry (dd, dm_table_get_devices(table), list)
-               deps->dev[count++] = huge_encode_dev(dd->bdev->bd_dev);
+               deps->dev[count++] = huge_encode_dev(dd->dm_dev.bdev->bd_dev);
  
        param->data_size = param->data_start + needed;
  }
diff --combined drivers/md/dm-mpath.c
index 3d3848132c6925ae711734d45efc2380c23c9784,b2ab8489d0eb3bc8dec6e638a01e2c4f165ced36..103304c1e3b06899d8277cd95369e3df94da36db
@@@ -30,10 -30,10 +30,11 @@@ struct pgpath 
        struct list_head list;
  
        struct priority_group *pg;      /* Owning PG */
+       unsigned is_active;             /* Path status */
        unsigned fail_count;            /* Cumulative failure count */
  
        struct dm_path path;
 +      struct work_struct deactivate_path;
  };
  
  #define path_to_pgpath(__pgp) container_of((__pgp), struct pgpath, path)
@@@ -113,7 -113,6 +114,7 @@@ static struct workqueue_struct *kmultip
  static void process_queued_ios(struct work_struct *work);
  static void trigger_event(struct work_struct *work);
  static void activate_path(struct work_struct *work);
 +static void deactivate_path(struct work_struct *work);
  
  
  /*-----------------------------------------------
@@@ -124,10 -123,8 +125,10 @@@ static struct pgpath *alloc_pgpath(void
  {
        struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
  
 -      if (pgpath)
 +      if (pgpath) {
-               pgpath->path.is_active = 1;
+               pgpath->is_active = 1;
 +              INIT_WORK(&pgpath->deactivate_path, deactivate_path);
 +      }
  
        return pgpath;
  }
@@@ -137,14 -134,6 +138,14 @@@ static void free_pgpath(struct pgpath *
        kfree(pgpath);
  }
  
 +static void deactivate_path(struct work_struct *work)
 +{
 +      struct pgpath *pgpath =
 +              container_of(work, struct pgpath, deactivate_path);
 +
 +      blk_abort_queue(pgpath->path.dev->bdev->bd_disk->queue);
 +}
 +
  static struct priority_group *alloc_priority_group(void)
  {
        struct priority_group *pg;
@@@ -575,12 -564,12 +576,12 @@@ static struct pgpath *parse_path(struc
        /* we need at least a path arg */
        if (as->argc < 1) {
                ti->error = "no device given";
-               return NULL;
+               return ERR_PTR(-EINVAL);
        }
  
        p = alloc_pgpath();
        if (!p)
-               return NULL;
+               return ERR_PTR(-ENOMEM);
  
        r = dm_get_device(ti, shift(as), ti->begin, ti->len,
                          dm_table_get_mode(ti->table), &p->path.dev);
  
   bad:
        free_pgpath(p);
-       return NULL;
+       return ERR_PTR(r);
  }
  
  static struct priority_group *parse_priority_group(struct arg_set *as,
  
        if (as->argc < 2) {
                as->argc = 0;
-               ti->error = "not enough priority group aruments";
-               return NULL;
+               ti->error = "not enough priority group arguments";
+               return ERR_PTR(-EINVAL);
        }
  
        pg = alloc_priority_group();
        if (!pg) {
                ti->error = "couldn't allocate priority group";
-               return NULL;
+               return ERR_PTR(-ENOMEM);
        }
        pg->m = m;
  
                path_args.argv = as->argv;
  
                pgpath = parse_path(&path_args, &pg->ps, ti);
-               if (!pgpath)
+               if (IS_ERR(pgpath)) {
+                       r = PTR_ERR(pgpath);
                        goto bad;
+               }
  
                pgpath->pg = pg;
                list_add_tail(&pgpath->list, &pg->pgpaths);
  
   bad:
        free_priority_group(pg, ti);
-       return NULL;
+       return ERR_PTR(r);
  }
  
  static int parse_hw_handler(struct arg_set *as, struct multipath *m)
@@@ -797,8 -788,8 +800,8 @@@ static int multipath_ctr(struct dm_targ
                struct priority_group *pg;
  
                pg = parse_priority_group(&as, m);
-               if (!pg) {
-                       r = -EINVAL;
+               if (IS_ERR(pg)) {
+                       r = PTR_ERR(pg);
                        goto bad;
                }
  
@@@ -864,13 -855,13 +867,13 @@@ static int fail_path(struct pgpath *pgp
  
        spin_lock_irqsave(&m->lock, flags);
  
-       if (!pgpath->path.is_active)
+       if (!pgpath->is_active)
                goto out;
  
        DMWARN("Failing path %s.", pgpath->path.dev->name);
  
        pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
-       pgpath->path.is_active = 0;
+       pgpath->is_active = 0;
        pgpath->fail_count++;
  
        m->nr_valid_paths--;
                      pgpath->path.dev->name, m->nr_valid_paths);
  
        queue_work(kmultipathd, &m->trigger_event);
 +      queue_work(kmultipathd, &pgpath->deactivate_path);
  
  out:
        spin_unlock_irqrestore(&m->lock, flags);
@@@ -901,7 -891,7 +904,7 @@@ static int reinstate_path(struct pgpat
  
        spin_lock_irqsave(&m->lock, flags);
  
-       if (pgpath->path.is_active)
+       if (pgpath->is_active)
                goto out;
  
        if (!pgpath->pg->ps.type->reinstate_path) {
        if (r)
                goto out;
  
-       pgpath->path.is_active = 1;
+       pgpath->is_active = 1;
  
        m->current_pgpath = NULL;
        if (!m->nr_valid_paths++ && m->queue_size)
@@@ -1303,7 -1293,7 +1306,7 @@@ static int multipath_status(struct dm_t
  
                        list_for_each_entry(p, &pg->pgpaths, list) {
                                DMEMIT("%s %s %u ", p->path.dev->name,
-                                      p->path.is_active ? "A" : "F",
+                                      p->is_active ? "A" : "F",
                                       p->fail_count);
                                if (pg->ps.type->status)
                                        sz += pg->ps.type->status(&pg->ps,
This page took 0.076994 seconds and 4 git commands to generate.