]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'target-updates/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Nov 2012 00:32:29 +0000 (11:32 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Nov 2012 00:32:29 +0000 (11:32 +1100)
1  2 
drivers/target/iscsi/iscsi_target_util.c
drivers/target/target_core_configfs.c
drivers/target/target_core_device.c
drivers/target/target_core_sbc.c
drivers/target/target_core_spc.c
drivers/target/target_core_tmr.c
drivers/target/target_core_transport.c

Simple merge
index 9abef9f8eb760a88e7073802ceec77197421bf97,308bfdcfadfa84d5243564a91279bca91e753d93..066e8159afcddb59da08c4cfbb1a6488c2bc4734
@@@ -856,75 -667,17 +668,16 @@@ static u32 se_dev_align_max_sectors(u3
         * Limit max_sectors to a PAGE_SIZE aligned value for modern
         * transport_allocate_data_tasks() operation.
         */
 -      tmp = rounddown((max_sectors * block_size), PAGE_SIZE);
 -      aligned_max_sectors = (tmp / block_size);
 -      if (max_sectors != aligned_max_sectors) {
 -              printk(KERN_INFO "Rounding down aligned max_sectors from %u"
 -                              " to %u\n", max_sectors, aligned_max_sectors);
 -              return aligned_max_sectors;
 -      }
 +      alignment = max(1ul, PAGE_SIZE / block_size);
 +      aligned_max_sectors = rounddown(max_sectors, alignment);
 +
 +      if (max_sectors != aligned_max_sectors)
 +              pr_info("Rounding down aligned max_sectors from %u to %u\n",
 +                      max_sectors, aligned_max_sectors);
  
 -      return max_sectors;
 +      return aligned_max_sectors;
  }
  
- void se_dev_set_default_attribs(
-       struct se_device *dev,
-       struct se_dev_limits *dev_limits)
- {
-       struct queue_limits *limits = &dev_limits->limits;
-       dev->se_sub_dev->se_dev_attrib.emulate_dpo = DA_EMULATE_DPO;
-       dev->se_sub_dev->se_dev_attrib.emulate_fua_write = DA_EMULATE_FUA_WRITE;
-       dev->se_sub_dev->se_dev_attrib.emulate_fua_read = DA_EMULATE_FUA_READ;
-       dev->se_sub_dev->se_dev_attrib.emulate_write_cache = DA_EMULATE_WRITE_CACHE;
-       dev->se_sub_dev->se_dev_attrib.emulate_ua_intlck_ctrl = DA_EMULATE_UA_INTLLCK_CTRL;
-       dev->se_sub_dev->se_dev_attrib.emulate_tas = DA_EMULATE_TAS;
-       dev->se_sub_dev->se_dev_attrib.emulate_tpu = DA_EMULATE_TPU;
-       dev->se_sub_dev->se_dev_attrib.emulate_tpws = DA_EMULATE_TPWS;
-       dev->se_sub_dev->se_dev_attrib.emulate_reservations = DA_EMULATE_RESERVATIONS;
-       dev->se_sub_dev->se_dev_attrib.emulate_alua = DA_EMULATE_ALUA;
-       dev->se_sub_dev->se_dev_attrib.enforce_pr_isids = DA_ENFORCE_PR_ISIDS;
-       dev->se_sub_dev->se_dev_attrib.is_nonrot = DA_IS_NONROT;
-       dev->se_sub_dev->se_dev_attrib.emulate_rest_reord = DA_EMULATE_REST_REORD;
-       /*
-        * The TPU=1 and TPWS=1 settings will be set in TCM/IBLOCK
-        * iblock_create_virtdevice() from struct queue_limits values
-        * if blk_queue_discard()==1
-        */
-       dev->se_sub_dev->se_dev_attrib.max_unmap_lba_count = DA_MAX_UNMAP_LBA_COUNT;
-       dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count =
-               DA_MAX_UNMAP_BLOCK_DESC_COUNT;
-       dev->se_sub_dev->se_dev_attrib.unmap_granularity = DA_UNMAP_GRANULARITY_DEFAULT;
-       dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment =
-                               DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT;
-       /*
-        * block_size is based on subsystem plugin dependent requirements.
-        */
-       dev->se_sub_dev->se_dev_attrib.hw_block_size = limits->logical_block_size;
-       dev->se_sub_dev->se_dev_attrib.block_size = limits->logical_block_size;
-       /*
-        * Align max_hw_sectors down to PAGE_SIZE I/O transfers
-        */
-       limits->max_hw_sectors = se_dev_align_max_sectors(limits->max_hw_sectors,
-                                               limits->logical_block_size);
-       dev->se_sub_dev->se_dev_attrib.hw_max_sectors = limits->max_hw_sectors;
-       /*
-        * Set fabric_max_sectors, which is reported in block limits
-        * VPD page (B0h).
-        */
-       dev->se_sub_dev->se_dev_attrib.fabric_max_sectors = DA_FABRIC_MAX_SECTORS;
-       /*
-        * Set optimal_sectors from fabric_max_sectors, which can be
-        * lowered via configfs.
-        */
-       dev->se_sub_dev->se_dev_attrib.optimal_sectors = DA_FABRIC_MAX_SECTORS;
-       /*
-        * queue_depth is based on subsystem plugin dependent requirements.
-        */
-       dev->se_sub_dev->se_dev_attrib.hw_queue_depth = dev_limits->hw_queue_depth;
-       dev->se_sub_dev->se_dev_attrib.queue_depth = dev_limits->queue_depth;
- }
  int se_dev_set_max_unmap_lba_count(
        struct se_device *dev,
        u32 max_unmap_lba_count)
index a6e27d967c7b7b4abc53dd194927252ed2cde897,412d0d891c0cf76a36f43f23ee56625c71a8cfdd..a4eb9c5536548d1bdf0bb29d42f98519de24ec22
@@@ -135,15 -135,9 +135,15 @@@ static int sbc_emulate_verify(struct se
        return 0;
  }
  
 +static int sbc_emulate_noop(struct se_cmd *cmd)
 +{
 +      target_complete_cmd(cmd, GOOD);
 +      return 0;
 +}
 +
  static inline u32 sbc_get_size(struct se_cmd *cmd, u32 sectors)
  {
-       return cmd->se_dev->se_sub_dev->se_dev_attrib.block_size * sectors;
+       return cmd->se_dev->dev_attrib.block_size * sectors;
  }
  
  static int sbc_check_valid_sectors(struct se_cmd *cmd)
Simple merge
Simple merge