linux/drivers/scsi/sd.c
<<
>>
Prefs
   1/*
   2 *      sd.c Copyright (C) 1992 Drew Eckhardt
   3 *           Copyright (C) 1993, 1994, 1995, 1999 Eric Youngdale
   4 *
   5 *      Linux scsi disk driver
   6 *              Initial versions: Drew Eckhardt
   7 *              Subsequent revisions: Eric Youngdale
   8 *      Modification history:
   9 *       - Drew Eckhardt <drew@colorado.edu> original
  10 *       - Eric Youngdale <eric@andante.org> add scatter-gather, multiple 
  11 *         outstanding request, and other enhancements.
  12 *         Support loadable low-level scsi drivers.
  13 *       - Jirka Hanika <geo@ff.cuni.cz> support more scsi disks using 
  14 *         eight major numbers.
  15 *       - Richard Gooch <rgooch@atnf.csiro.au> support devfs.
  16 *       - Torben Mathiasen <tmm@image.dk> Resource allocation fixes in 
  17 *         sd_init and cleanups.
  18 *       - Alex Davis <letmein@erols.com> Fix problem where partition info
  19 *         not being read in sd_open. Fix problem where removable media 
  20 *         could be ejected after sd_open.
  21 *       - Douglas Gilbert <dgilbert@interlog.com> cleanup for lk 2.5.x
  22 *       - Badari Pulavarty <pbadari@us.ibm.com>, Matthew Wilcox 
  23 *         <willy@debian.org>, Kurt Garloff <garloff@suse.de>: 
  24 *         Support 32k/1M disks.
  25 *
  26 *      Logging policy (needs CONFIG_SCSI_LOGGING defined):
  27 *       - setting up transfer: SCSI_LOG_HLQUEUE levels 1 and 2
  28 *       - end of transfer (bh + scsi_lib): SCSI_LOG_HLCOMPLETE level 1
  29 *       - entering sd_ioctl: SCSI_LOG_IOCTL level 1
  30 *       - entering other commands: SCSI_LOG_HLQUEUE level 3
  31 *      Note: when the logging level is set by the user, it must be greater
  32 *      than the level indicated above to trigger output.       
  33 */
  34
  35#include <linux/module.h>
  36#include <linux/fs.h>
  37#include <linux/kernel.h>
  38#include <linux/mm.h>
  39#include <linux/bio.h>
  40#include <linux/genhd.h>
  41#include <linux/hdreg.h>
  42#include <linux/errno.h>
  43#include <linux/idr.h>
  44#include <linux/interrupt.h>
  45#include <linux/init.h>
  46#include <linux/blkdev.h>
  47#include <linux/blkpg.h>
  48#include <linux/delay.h>
  49#include <linux/mutex.h>
  50#include <linux/string_helpers.h>
  51#include <linux/async.h>
  52#include <linux/slab.h>
  53#include <linux/pm_runtime.h>
  54#include <asm/uaccess.h>
  55#include <asm/unaligned.h>
  56
  57#include <scsi/scsi.h>
  58#include <scsi/scsi_cmnd.h>
  59#include <scsi/scsi_dbg.h>
  60#include <scsi/scsi_device.h>
  61#include <scsi/scsi_driver.h>
  62#include <scsi/scsi_eh.h>
  63#include <scsi/scsi_host.h>
  64#include <scsi/scsi_ioctl.h>
  65#include <scsi/scsicam.h>
  66
  67#include "sd.h"
  68#include "scsi_priv.h"
  69#include "scsi_logging.h"
  70
  71MODULE_AUTHOR("Eric Youngdale");
  72MODULE_DESCRIPTION("SCSI disk (sd) driver");
  73MODULE_LICENSE("GPL");
  74
  75MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK0_MAJOR);
  76MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK1_MAJOR);
  77MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK2_MAJOR);
  78MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK3_MAJOR);
  79MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK4_MAJOR);
  80MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK5_MAJOR);
  81MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK6_MAJOR);
  82MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK7_MAJOR);
  83MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK8_MAJOR);
  84MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK9_MAJOR);
  85MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK10_MAJOR);
  86MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK11_MAJOR);
  87MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK12_MAJOR);
  88MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK13_MAJOR);
  89MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK14_MAJOR);
  90MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK15_MAJOR);
  91MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK);
  92MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD);
  93MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC);
  94
  95#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
  96#define SD_MINORS       16
  97#else
  98#define SD_MINORS       0
  99#endif
 100
 101static void sd_config_discard(struct scsi_disk *, unsigned int);
 102static int  sd_revalidate_disk(struct gendisk *);
 103static void sd_unlock_native_capacity(struct gendisk *disk);
 104static int  sd_probe(struct device *);
 105static int  sd_remove(struct device *);
 106static void sd_shutdown(struct device *);
 107static int sd_suspend(struct device *, pm_message_t state);
 108static int sd_resume(struct device *);
 109static void sd_rescan(struct device *);
 110static int sd_done(struct scsi_cmnd *);
 111static int sd_eh_action(struct scsi_cmnd *, unsigned char *, int, int);
 112static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
 113static void scsi_disk_release(struct device *cdev);
 114static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
 115static void sd_print_result(struct scsi_disk *, int);
 116
 117static DEFINE_SPINLOCK(sd_index_lock);
 118static DEFINE_IDA(sd_index_ida);
 119
 120/* This semaphore is used to mediate the 0->1 reference get in the
 121 * face of object destruction (i.e. we can't allow a get on an
 122 * object after last put) */
 123static DEFINE_MUTEX(sd_ref_mutex);
 124
 125static struct kmem_cache *sd_cdb_cache;
 126static mempool_t *sd_cdb_pool;
 127
 128static const char *sd_cache_types[] = {
 129        "write through", "none", "write back",
 130        "write back, no read (daft)"
 131};
 132
 133static ssize_t
 134sd_store_cache_type(struct device *dev, struct device_attribute *attr,
 135                    const char *buf, size_t count)
 136{
 137        int i, ct = -1, rcd, wce, sp;
 138        struct scsi_disk *sdkp = to_scsi_disk(dev);
 139        struct scsi_device *sdp = sdkp->device;
 140        char buffer[64];
 141        char *buffer_data;
 142        struct scsi_mode_data data;
 143        struct scsi_sense_hdr sshdr;
 144        int len;
 145
 146        if (sdp->type != TYPE_DISK)
 147                /* no cache control on RBC devices; theoretically they
 148                 * can do it, but there's probably so many exceptions
 149                 * it's not worth the risk */
 150                return -EINVAL;
 151
 152        for (i = 0; i < ARRAY_SIZE(sd_cache_types); i++) {
 153                len = strlen(sd_cache_types[i]);
 154                if (strncmp(sd_cache_types[i], buf, len) == 0 &&
 155                    buf[len] == '\n') {
 156                        ct = i;
 157                        break;
 158                }
 159        }
 160        if (ct < 0)
 161                return -EINVAL;
 162        rcd = ct & 0x01 ? 1 : 0;
 163        wce = ct & 0x02 ? 1 : 0;
 164        if (scsi_mode_sense(sdp, 0x08, 8, buffer, sizeof(buffer), SD_TIMEOUT,
 165                            SD_MAX_RETRIES, &data, NULL))
 166                return -EINVAL;
 167        len = min_t(size_t, sizeof(buffer), data.length - data.header_length -
 168                  data.block_descriptor_length);
 169        buffer_data = buffer + data.header_length +
 170                data.block_descriptor_length;
 171        buffer_data[2] &= ~0x05;
 172        buffer_data[2] |= wce << 2 | rcd;
 173        sp = buffer_data[0] & 0x80 ? 1 : 0;
 174
 175        if (scsi_mode_select(sdp, 1, sp, 8, buffer_data, len, SD_TIMEOUT,
 176                             SD_MAX_RETRIES, &data, &sshdr)) {
 177                if (scsi_sense_valid(&sshdr))
 178                        sd_print_sense_hdr(sdkp, &sshdr);
 179                return -EINVAL;
 180        }
 181        revalidate_disk(sdkp->disk);
 182        return count;
 183}
 184
 185static ssize_t
 186sd_store_manage_start_stop(struct device *dev, struct device_attribute *attr,
 187                           const char *buf, size_t count)
 188{
 189        struct scsi_disk *sdkp = to_scsi_disk(dev);
 190        struct scsi_device *sdp = sdkp->device;
 191
 192        if (!capable(CAP_SYS_ADMIN))
 193                return -EACCES;
 194
 195        sdp->manage_start_stop = simple_strtoul(buf, NULL, 10);
 196
 197        return count;
 198}
 199
 200static ssize_t
 201sd_store_allow_restart(struct device *dev, struct device_attribute *attr,
 202                       const char *buf, size_t count)
 203{
 204        struct scsi_disk *sdkp = to_scsi_disk(dev);
 205        struct scsi_device *sdp = sdkp->device;
 206
 207        if (!capable(CAP_SYS_ADMIN))
 208                return -EACCES;
 209
 210        if (sdp->type != TYPE_DISK)
 211                return -EINVAL;
 212
 213        sdp->allow_restart = simple_strtoul(buf, NULL, 10);
 214
 215        return count;
 216}
 217
 218static ssize_t
 219sd_show_cache_type(struct device *dev, struct device_attribute *attr,
 220                   char *buf)
 221{
 222        struct scsi_disk *sdkp = to_scsi_disk(dev);
 223        int ct = sdkp->RCD + 2*sdkp->WCE;
 224
 225        return snprintf(buf, 40, "%s\n", sd_cache_types[ct]);
 226}
 227
 228static ssize_t
 229sd_show_fua(struct device *dev, struct device_attribute *attr, char *buf)
 230{
 231        struct scsi_disk *sdkp = to_scsi_disk(dev);
 232
 233        return snprintf(buf, 20, "%u\n", sdkp->DPOFUA);
 234}
 235
 236static ssize_t
 237sd_show_manage_start_stop(struct device *dev, struct device_attribute *attr,
 238                          char *buf)
 239{
 240        struct scsi_disk *sdkp = to_scsi_disk(dev);
 241        struct scsi_device *sdp = sdkp->device;
 242
 243        return snprintf(buf, 20, "%u\n", sdp->manage_start_stop);
 244}
 245
 246static ssize_t
 247sd_show_allow_restart(struct device *dev, struct device_attribute *attr,
 248                      char *buf)
 249{
 250        struct scsi_disk *sdkp = to_scsi_disk(dev);
 251
 252        return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart);
 253}
 254
 255static ssize_t
 256sd_show_protection_type(struct device *dev, struct device_attribute *attr,
 257                        char *buf)
 258{
 259        struct scsi_disk *sdkp = to_scsi_disk(dev);
 260
 261        return snprintf(buf, 20, "%u\n", sdkp->protection_type);
 262}
 263
 264static ssize_t
 265sd_show_protection_mode(struct device *dev, struct device_attribute *attr,
 266                        char *buf)
 267{
 268        struct scsi_disk *sdkp = to_scsi_disk(dev);
 269        struct scsi_device *sdp = sdkp->device;
 270        unsigned int dif, dix;
 271
 272        dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type);
 273        dix = scsi_host_dix_capable(sdp->host, sdkp->protection_type);
 274
 275        if (!dix && scsi_host_dix_capable(sdp->host, SD_DIF_TYPE0_PROTECTION)) {
 276                dif = 0;
 277                dix = 1;
 278        }
 279
 280        if (!dif && !dix)
 281                return snprintf(buf, 20, "none\n");
 282
 283        return snprintf(buf, 20, "%s%u\n", dix ? "dix" : "dif", dif);
 284}
 285
 286static ssize_t
 287sd_show_app_tag_own(struct device *dev, struct device_attribute *attr,
 288                    char *buf)
 289{
 290        struct scsi_disk *sdkp = to_scsi_disk(dev);
 291
 292        return snprintf(buf, 20, "%u\n", sdkp->ATO);
 293}
 294
 295static ssize_t
 296sd_show_thin_provisioning(struct device *dev, struct device_attribute *attr,
 297                          char *buf)
 298{
 299        struct scsi_disk *sdkp = to_scsi_disk(dev);
 300
 301        return snprintf(buf, 20, "%u\n", sdkp->lbpme);
 302}
 303
 304static const char *lbp_mode[] = {
 305        [SD_LBP_FULL]           = "full",
 306        [SD_LBP_UNMAP]          = "unmap",
 307        [SD_LBP_WS16]           = "writesame_16",
 308        [SD_LBP_WS10]           = "writesame_10",
 309        [SD_LBP_ZERO]           = "writesame_zero",
 310        [SD_LBP_DISABLE]        = "disabled",
 311};
 312
 313static ssize_t
 314sd_show_provisioning_mode(struct device *dev, struct device_attribute *attr,
 315                          char *buf)
 316{
 317        struct scsi_disk *sdkp = to_scsi_disk(dev);
 318
 319        return snprintf(buf, 20, "%s\n", lbp_mode[sdkp->provisioning_mode]);
 320}
 321
 322static ssize_t
 323sd_store_provisioning_mode(struct device *dev, struct device_attribute *attr,
 324                           const char *buf, size_t count)
 325{
 326        struct scsi_disk *sdkp = to_scsi_disk(dev);
 327        struct scsi_device *sdp = sdkp->device;
 328
 329        if (!capable(CAP_SYS_ADMIN))
 330                return -EACCES;
 331
 332        if (sdp->type != TYPE_DISK)
 333                return -EINVAL;
 334
 335        if (!strncmp(buf, lbp_mode[SD_LBP_UNMAP], 20))
 336                sd_config_discard(sdkp, SD_LBP_UNMAP);
 337        else if (!strncmp(buf, lbp_mode[SD_LBP_WS16], 20))
 338                sd_config_discard(sdkp, SD_LBP_WS16);
 339        else if (!strncmp(buf, lbp_mode[SD_LBP_WS10], 20))
 340                sd_config_discard(sdkp, SD_LBP_WS10);
 341        else if (!strncmp(buf, lbp_mode[SD_LBP_ZERO], 20))
 342                sd_config_discard(sdkp, SD_LBP_ZERO);
 343        else if (!strncmp(buf, lbp_mode[SD_LBP_DISABLE], 20))
 344                sd_config_discard(sdkp, SD_LBP_DISABLE);
 345        else
 346                return -EINVAL;
 347
 348        return count;
 349}
 350
 351static ssize_t
 352sd_show_max_medium_access_timeouts(struct device *dev,
 353                                   struct device_attribute *attr, char *buf)
 354{
 355        struct scsi_disk *sdkp = to_scsi_disk(dev);
 356
 357        return snprintf(buf, 20, "%u\n", sdkp->max_medium_access_timeouts);
 358}
 359
 360static ssize_t
 361sd_store_max_medium_access_timeouts(struct device *dev,
 362                                    struct device_attribute *attr,
 363                                    const char *buf, size_t count)
 364{
 365        struct scsi_disk *sdkp = to_scsi_disk(dev);
 366        int err;
 367
 368        if (!capable(CAP_SYS_ADMIN))
 369                return -EACCES;
 370
 371        err = kstrtouint(buf, 10, &sdkp->max_medium_access_timeouts);
 372
 373        return err ? err : count;
 374}
 375
 376static struct device_attribute sd_disk_attrs[] = {
 377        __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type,
 378               sd_store_cache_type),
 379        __ATTR(FUA, S_IRUGO, sd_show_fua, NULL),
 380        __ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart,
 381               sd_store_allow_restart),
 382        __ATTR(manage_start_stop, S_IRUGO|S_IWUSR, sd_show_manage_start_stop,
 383               sd_store_manage_start_stop),
 384        __ATTR(protection_type, S_IRUGO, sd_show_protection_type, NULL),
 385        __ATTR(protection_mode, S_IRUGO, sd_show_protection_mode, NULL),
 386        __ATTR(app_tag_own, S_IRUGO, sd_show_app_tag_own, NULL),
 387        __ATTR(thin_provisioning, S_IRUGO, sd_show_thin_provisioning, NULL),
 388        __ATTR(provisioning_mode, S_IRUGO|S_IWUSR, sd_show_provisioning_mode,
 389               sd_store_provisioning_mode),
 390        __ATTR(max_medium_access_timeouts, S_IRUGO|S_IWUSR,
 391               sd_show_max_medium_access_timeouts,
 392               sd_store_max_medium_access_timeouts),
 393        __ATTR_NULL,
 394};
 395
 396static struct class sd_disk_class = {
 397        .name           = "scsi_disk",
 398        .owner          = THIS_MODULE,
 399        .dev_release    = scsi_disk_release,
 400        .dev_attrs      = sd_disk_attrs,
 401};
 402
 403static struct scsi_driver sd_template = {
 404        .owner                  = THIS_MODULE,
 405        .gendrv = {
 406                .name           = "sd",
 407                .probe          = sd_probe,
 408                .remove         = sd_remove,
 409                .suspend        = sd_suspend,
 410                .resume         = sd_resume,
 411                .shutdown       = sd_shutdown,
 412        },
 413        .rescan                 = sd_rescan,
 414        .done                   = sd_done,
 415        .eh_action              = sd_eh_action,
 416};
 417
 418/*
 419 * Device no to disk mapping:
 420 * 
 421 *       major         disc2     disc  p1
 422 *   |............|.............|....|....| <- dev_t
 423 *    31        20 19          8 7  4 3  0
 424 * 
 425 * Inside a major, we have 16k disks, however mapped non-
 426 * contiguously. The first 16 disks are for major0, the next
 427 * ones with major1, ... Disk 256 is for major0 again, disk 272 
 428 * for major1, ... 
 429 * As we stay compatible with our numbering scheme, we can reuse 
 430 * the well-know SCSI majors 8, 65--71, 136--143.
 431 */
 432static int sd_major(int major_idx)
 433{
 434        switch (major_idx) {
 435        case 0:
 436                return SCSI_DISK0_MAJOR;
 437        case 1 ... 7:
 438                return SCSI_DISK1_MAJOR + major_idx - 1;
 439        case 8 ... 15:
 440                return SCSI_DISK8_MAJOR + major_idx - 8;
 441        default:
 442                BUG();
 443                return 0;       /* shut up gcc */
 444        }
 445}
 446
 447static struct scsi_disk *__scsi_disk_get(struct gendisk *disk)
 448{
 449        struct scsi_disk *sdkp = NULL;
 450
 451        if (disk->private_data) {
 452                sdkp = scsi_disk(disk);
 453                if (scsi_device_get(sdkp->device) == 0)
 454                        get_device(&sdkp->dev);
 455                else
 456                        sdkp = NULL;
 457        }
 458        return sdkp;
 459}
 460
 461static struct scsi_disk *scsi_disk_get(struct gendisk *disk)
 462{
 463        struct scsi_disk *sdkp;
 464
 465        mutex_lock(&sd_ref_mutex);
 466        sdkp = __scsi_disk_get(disk);
 467        mutex_unlock(&sd_ref_mutex);
 468        return sdkp;
 469}
 470
 471static struct scsi_disk *scsi_disk_get_from_dev(struct device *dev)
 472{
 473        struct scsi_disk *sdkp;
 474
 475        mutex_lock(&sd_ref_mutex);
 476        sdkp = dev_get_drvdata(dev);
 477        if (sdkp)
 478                sdkp = __scsi_disk_get(sdkp->disk);
 479        mutex_unlock(&sd_ref_mutex);
 480        return sdkp;
 481}
 482
 483static void scsi_disk_put(struct scsi_disk *sdkp)
 484{
 485        struct scsi_device *sdev = sdkp->device;
 486
 487        mutex_lock(&sd_ref_mutex);
 488        put_device(&sdkp->dev);
 489        scsi_device_put(sdev);
 490        mutex_unlock(&sd_ref_mutex);
 491}
 492
 493static void sd_prot_op(struct scsi_cmnd *scmd, unsigned int dif)
 494{
 495        unsigned int prot_op = SCSI_PROT_NORMAL;
 496        unsigned int dix = scsi_prot_sg_count(scmd);
 497
 498        if (scmd->sc_data_direction == DMA_FROM_DEVICE) {
 499                if (dif && dix)
 500                        prot_op = SCSI_PROT_READ_PASS;
 501                else if (dif && !dix)
 502                        prot_op = SCSI_PROT_READ_STRIP;
 503                else if (!dif && dix)
 504                        prot_op = SCSI_PROT_READ_INSERT;
 505        } else {
 506                if (dif && dix)
 507                        prot_op = SCSI_PROT_WRITE_PASS;
 508                else if (dif && !dix)
 509                        prot_op = SCSI_PROT_WRITE_INSERT;
 510                else if (!dif && dix)
 511                        prot_op = SCSI_PROT_WRITE_STRIP;
 512        }
 513
 514        scsi_set_prot_op(scmd, prot_op);
 515        scsi_set_prot_type(scmd, dif);
 516}
 517
 518static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
 519{
 520        struct request_queue *q = sdkp->disk->queue;
 521        unsigned int logical_block_size = sdkp->device->sector_size;
 522        unsigned int max_blocks = 0;
 523
 524        q->limits.discard_zeroes_data = sdkp->lbprz;
 525        q->limits.discard_alignment = sdkp->unmap_alignment *
 526                logical_block_size;
 527        q->limits.discard_granularity =
 528                max(sdkp->physical_block_size,
 529                    sdkp->unmap_granularity * logical_block_size);
 530
 531        sdkp->provisioning_mode = mode;
 532
 533        switch (mode) {
 534
 535        case SD_LBP_DISABLE:
 536                q->limits.max_discard_sectors = 0;
 537                queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q);
 538                return;
 539
 540        case SD_LBP_UNMAP:
 541                max_blocks = min_not_zero(sdkp->max_unmap_blocks, 0xffffffff);
 542                break;
 543
 544        case SD_LBP_WS16:
 545                max_blocks = min_not_zero(sdkp->max_ws_blocks, 0xffffffff);
 546                break;
 547
 548        case SD_LBP_WS10:
 549                max_blocks = min_not_zero(sdkp->max_ws_blocks, (u32)0xffff);
 550                break;
 551
 552        case SD_LBP_ZERO:
 553                max_blocks = min_not_zero(sdkp->max_ws_blocks, (u32)0xffff);
 554                q->limits.discard_zeroes_data = 1;
 555                break;
 556        }
 557
 558        q->limits.max_discard_sectors = max_blocks * (logical_block_size >> 9);
 559        queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
 560}
 561
 562/**
 563 * scsi_setup_discard_cmnd - unmap blocks on thinly provisioned device
 564 * @sdp: scsi device to operate one
 565 * @rq: Request to prepare
 566 *
 567 * Will issue either UNMAP or WRITE SAME(16) depending on preference
 568 * indicated by target device.
 569 **/
 570static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
 571{
 572        struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
 573        struct bio *bio = rq->bio;
 574        sector_t sector = bio->bi_sector;
 575        unsigned int nr_sectors = bio_sectors(bio);
 576        unsigned int len;
 577        int ret;
 578        char *buf;
 579        struct page *page;
 580
 581        if (sdkp->device->sector_size == 4096) {
 582                sector >>= 3;
 583                nr_sectors >>= 3;
 584        }
 585
 586        rq->timeout = SD_TIMEOUT;
 587
 588        memset(rq->cmd, 0, rq->cmd_len);
 589
 590        page = alloc_page(GFP_ATOMIC | __GFP_ZERO);
 591        if (!page)
 592                return BLKPREP_DEFER;
 593
 594        switch (sdkp->provisioning_mode) {
 595        case SD_LBP_UNMAP:
 596                buf = page_address(page);
 597
 598                rq->cmd_len = 10;
 599                rq->cmd[0] = UNMAP;
 600                rq->cmd[8] = 24;
 601
 602                put_unaligned_be16(6 + 16, &buf[0]);
 603                put_unaligned_be16(16, &buf[2]);
 604                put_unaligned_be64(sector, &buf[8]);
 605                put_unaligned_be32(nr_sectors, &buf[16]);
 606
 607                len = 24;
 608                break;
 609
 610        case SD_LBP_WS16:
 611                rq->cmd_len = 16;
 612                rq->cmd[0] = WRITE_SAME_16;
 613                rq->cmd[1] = 0x8; /* UNMAP */
 614                put_unaligned_be64(sector, &rq->cmd[2]);
 615                put_unaligned_be32(nr_sectors, &rq->cmd[10]);
 616
 617                len = sdkp->device->sector_size;
 618                break;
 619
 620        case SD_LBP_WS10:
 621        case SD_LBP_ZERO:
 622                rq->cmd_len = 10;
 623                rq->cmd[0] = WRITE_SAME;
 624                if (sdkp->provisioning_mode == SD_LBP_WS10)
 625                        rq->cmd[1] = 0x8; /* UNMAP */
 626                put_unaligned_be32(sector, &rq->cmd[2]);
 627                put_unaligned_be16(nr_sectors, &rq->cmd[7]);
 628
 629                len = sdkp->device->sector_size;
 630                break;
 631
 632        default:
 633                ret = BLKPREP_KILL;
 634                goto out;
 635        }
 636
 637        blk_add_request_payload(rq, page, len);
 638        ret = scsi_setup_blk_pc_cmnd(sdp, rq);
 639        rq->buffer = page_address(page);
 640
 641out:
 642        if (ret != BLKPREP_OK) {
 643                __free_page(page);
 644                rq->buffer = NULL;
 645        }
 646        return ret;
 647}
 648
 649static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
 650{
 651        rq->timeout = SD_FLUSH_TIMEOUT;
 652        rq->retries = SD_MAX_RETRIES;
 653        rq->cmd[0] = SYNCHRONIZE_CACHE;
 654        rq->cmd_len = 10;
 655
 656        return scsi_setup_blk_pc_cmnd(sdp, rq);
 657}
 658
 659static void sd_unprep_fn(struct request_queue *q, struct request *rq)
 660{
 661        if (rq->cmd_flags & REQ_DISCARD) {
 662                free_page((unsigned long)rq->buffer);
 663                rq->buffer = NULL;
 664        }
 665}
 666
 667/**
 668 *      sd_prep_fn - build a scsi (read or write) command from
 669 *      information in the request structure.
 670 *      @SCpnt: pointer to mid-level's per scsi command structure that
 671 *      contains request and into which the scsi command is written
 672 *
 673 *      Returns 1 if successful and 0 if error (or cannot be done now).
 674 **/
 675static int sd_prep_fn(struct request_queue *q, struct request *rq)
 676{
 677        struct scsi_cmnd *SCpnt;
 678        struct scsi_device *sdp = q->queuedata;
 679        struct gendisk *disk = rq->rq_disk;
 680        struct scsi_disk *sdkp;
 681        sector_t block = blk_rq_pos(rq);
 682        sector_t threshold;
 683        unsigned int this_count = blk_rq_sectors(rq);
 684        int ret, host_dif;
 685        unsigned char protect;
 686
 687        /*
 688         * Discard request come in as REQ_TYPE_FS but we turn them into
 689         * block PC requests to make life easier.
 690         */
 691        if (rq->cmd_flags & REQ_DISCARD) {
 692                ret = scsi_setup_discard_cmnd(sdp, rq);
 693                goto out;
 694        } else if (rq->cmd_flags & REQ_FLUSH) {
 695                ret = scsi_setup_flush_cmnd(sdp, rq);
 696                goto out;
 697        } else if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
 698                ret = scsi_setup_blk_pc_cmnd(sdp, rq);
 699                goto out;
 700        } else if (rq->cmd_type != REQ_TYPE_FS) {
 701                ret = BLKPREP_KILL;
 702                goto out;
 703        }
 704        ret = scsi_setup_fs_cmnd(sdp, rq);
 705        if (ret != BLKPREP_OK)
 706                goto out;
 707        SCpnt = rq->special;
 708        sdkp = scsi_disk(disk);
 709
 710        /* from here on until we're complete, any goto out
 711         * is used for a killable error condition */
 712        ret = BLKPREP_KILL;
 713
 714        SCSI_LOG_HLQUEUE(1, scmd_printk(KERN_INFO, SCpnt,
 715                                        "sd_prep_fn: block=%llu, "
 716                                        "count=%d\n",
 717                                        (unsigned long long)block,
 718                                        this_count));
 719
 720        if (!sdp || !scsi_device_online(sdp) ||
 721            block + blk_rq_sectors(rq) > get_capacity(disk)) {
 722                SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
 723                                                "Finishing %u sectors\n",
 724                                                blk_rq_sectors(rq)));
 725                SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
 726                                                "Retry with 0x%p\n", SCpnt));
 727                goto out;
 728        }
 729
 730        if (sdp->changed) {
 731                /*
 732                 * quietly refuse to do anything to a changed disc until 
 733                 * the changed bit has been reset
 734                 */
 735                /* printk("SCSI disk has been changed or is not present. Prohibiting further I/O.\n"); */
 736                goto out;
 737        }
 738
 739        /*
 740         * Some SD card readers can't handle multi-sector accesses which touch
 741         * the last one or two hardware sectors.  Split accesses as needed.
 742         */
 743        threshold = get_capacity(disk) - SD_LAST_BUGGY_SECTORS *
 744                (sdp->sector_size / 512);
 745
 746        if (unlikely(sdp->last_sector_bug && block + this_count > threshold)) {
 747                if (block < threshold) {
 748                        /* Access up to the threshold but not beyond */
 749                        this_count = threshold - block;
 750                } else {
 751                        /* Access only a single hardware sector */
 752                        this_count = sdp->sector_size / 512;
 753                }
 754        }
 755
 756        SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n",
 757                                        (unsigned long long)block));
 758
 759        /*
 760         * If we have a 1K hardware sectorsize, prevent access to single
 761         * 512 byte sectors.  In theory we could handle this - in fact
 762         * the scsi cdrom driver must be able to handle this because
 763         * we typically use 1K blocksizes, and cdroms typically have
 764         * 2K hardware sectorsizes.  Of course, things are simpler
 765         * with the cdrom, since it is read-only.  For performance
 766         * reasons, the filesystems should be able to handle this
 767         * and not force the scsi disk driver to use bounce buffers
 768         * for this.
 769         */
 770        if (sdp->sector_size == 1024) {
 771                if ((block & 1) || (blk_rq_sectors(rq) & 1)) {
 772                        scmd_printk(KERN_ERR, SCpnt,
 773                                    "Bad block number requested\n");
 774                        goto out;
 775                } else {
 776                        block = block >> 1;
 777                        this_count = this_count >> 1;
 778                }
 779        }
 780        if (sdp->sector_size == 2048) {
 781                if ((block & 3) || (blk_rq_sectors(rq) & 3)) {
 782                        scmd_printk(KERN_ERR, SCpnt,
 783                                    "Bad block number requested\n");
 784                        goto out;
 785                } else {
 786                        block = block >> 2;
 787                        this_count = this_count >> 2;
 788                }
 789        }
 790        if (sdp->sector_size == 4096) {
 791                if ((block & 7) || (blk_rq_sectors(rq) & 7)) {
 792                        scmd_printk(KERN_ERR, SCpnt,
 793                                    "Bad block number requested\n");
 794                        goto out;
 795                } else {
 796                        block = block >> 3;
 797                        this_count = this_count >> 3;
 798                }
 799        }
 800        if (rq_data_dir(rq) == WRITE) {
 801                if (!sdp->writeable) {
 802                        goto out;
 803                }
 804                SCpnt->cmnd[0] = WRITE_6;
 805                SCpnt->sc_data_direction = DMA_TO_DEVICE;
 806
 807                if (blk_integrity_rq(rq) &&
 808                    sd_dif_prepare(rq, block, sdp->sector_size) == -EIO)
 809                        goto out;
 810
 811        } else if (rq_data_dir(rq) == READ) {
 812                SCpnt->cmnd[0] = READ_6;
 813                SCpnt->sc_data_direction = DMA_FROM_DEVICE;
 814        } else {
 815                scmd_printk(KERN_ERR, SCpnt, "Unknown command %x\n", rq->cmd_flags);
 816                goto out;
 817        }
 818
 819        SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
 820                                        "%s %d/%u 512 byte blocks.\n",
 821                                        (rq_data_dir(rq) == WRITE) ?
 822                                        "writing" : "reading", this_count,
 823                                        blk_rq_sectors(rq)));
 824
 825        /* Set RDPROTECT/WRPROTECT if disk is formatted with DIF */
 826        host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type);
 827        if (host_dif)
 828                protect = 1 << 5;
 829        else
 830                protect = 0;
 831
 832        if (host_dif == SD_DIF_TYPE2_PROTECTION) {
 833                SCpnt->cmnd = mempool_alloc(sd_cdb_pool, GFP_ATOMIC);
 834
 835                if (unlikely(SCpnt->cmnd == NULL)) {
 836                        ret = BLKPREP_DEFER;
 837                        goto out;
 838                }
 839
 840                SCpnt->cmd_len = SD_EXT_CDB_SIZE;
 841                memset(SCpnt->cmnd, 0, SCpnt->cmd_len);
 842                SCpnt->cmnd[0] = VARIABLE_LENGTH_CMD;
 843                SCpnt->cmnd[7] = 0x18;
 844                SCpnt->cmnd[9] = (rq_data_dir(rq) == READ) ? READ_32 : WRITE_32;
 845                SCpnt->cmnd[10] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
 846
 847                /* LBA */
 848                SCpnt->cmnd[12] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0;
 849                SCpnt->cmnd[13] = sizeof(block) > 4 ? (unsigned char) (block >> 48) & 0xff : 0;
 850                SCpnt->cmnd[14] = sizeof(block) > 4 ? (unsigned char) (block >> 40) & 0xff : 0;
 851                SCpnt->cmnd[15] = sizeof(block) > 4 ? (unsigned char) (block >> 32) & 0xff : 0;
 852                SCpnt->cmnd[16] = (unsigned char) (block >> 24) & 0xff;
 853                SCpnt->cmnd[17] = (unsigned char) (block >> 16) & 0xff;
 854                SCpnt->cmnd[18] = (unsigned char) (block >> 8) & 0xff;
 855                SCpnt->cmnd[19] = (unsigned char) block & 0xff;
 856
 857                /* Expected Indirect LBA */
 858                SCpnt->cmnd[20] = (unsigned char) (block >> 24) & 0xff;
 859                SCpnt->cmnd[21] = (unsigned char) (block >> 16) & 0xff;
 860                SCpnt->cmnd[22] = (unsigned char) (block >> 8) & 0xff;
 861                SCpnt->cmnd[23] = (unsigned char) block & 0xff;
 862
 863                /* Transfer length */
 864                SCpnt->cmnd[28] = (unsigned char) (this_count >> 24) & 0xff;
 865                SCpnt->cmnd[29] = (unsigned char) (this_count >> 16) & 0xff;
 866                SCpnt->cmnd[30] = (unsigned char) (this_count >> 8) & 0xff;
 867                SCpnt->cmnd[31] = (unsigned char) this_count & 0xff;
 868        } else if (block > 0xffffffff) {
 869                SCpnt->cmnd[0] += READ_16 - READ_6;
 870                SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
 871                SCpnt->cmnd[2] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0;
 872                SCpnt->cmnd[3] = sizeof(block) > 4 ? (unsigned char) (block >> 48) & 0xff : 0;
 873                SCpnt->cmnd[4] = sizeof(block) > 4 ? (unsigned char) (block >> 40) & 0xff : 0;
 874                SCpnt->cmnd[5] = sizeof(block) > 4 ? (unsigned char) (block >> 32) & 0xff : 0;
 875                SCpnt->cmnd[6] = (unsigned char) (block >> 24) & 0xff;
 876                SCpnt->cmnd[7] = (unsigned char) (block >> 16) & 0xff;
 877                SCpnt->cmnd[8] = (unsigned char) (block >> 8) & 0xff;
 878                SCpnt->cmnd[9] = (unsigned char) block & 0xff;
 879                SCpnt->cmnd[10] = (unsigned char) (this_count >> 24) & 0xff;
 880                SCpnt->cmnd[11] = (unsigned char) (this_count >> 16) & 0xff;
 881                SCpnt->cmnd[12] = (unsigned char) (this_count >> 8) & 0xff;
 882                SCpnt->cmnd[13] = (unsigned char) this_count & 0xff;
 883                SCpnt->cmnd[14] = SCpnt->cmnd[15] = 0;
 884        } else if ((this_count > 0xff) || (block > 0x1fffff) ||
 885                   scsi_device_protection(SCpnt->device) ||
 886                   SCpnt->device->use_10_for_rw) {
 887                if (this_count > 0xffff)
 888                        this_count = 0xffff;
 889
 890                SCpnt->cmnd[0] += READ_10 - READ_6;
 891                SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
 892                SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff;
 893                SCpnt->cmnd[3] = (unsigned char) (block >> 16) & 0xff;
 894                SCpnt->cmnd[4] = (unsigned char) (block >> 8) & 0xff;
 895                SCpnt->cmnd[5] = (unsigned char) block & 0xff;
 896                SCpnt->cmnd[6] = SCpnt->cmnd[9] = 0;
 897                SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff;
 898                SCpnt->cmnd[8] = (unsigned char) this_count & 0xff;
 899        } else {
 900                if (unlikely(rq->cmd_flags & REQ_FUA)) {
 901                        /*
 902                         * This happens only if this drive failed
 903                         * 10byte rw command with ILLEGAL_REQUEST
 904                         * during operation and thus turned off
 905                         * use_10_for_rw.
 906                         */
 907                        scmd_printk(KERN_ERR, SCpnt,
 908                                    "FUA write on READ/WRITE(6) drive\n");
 909                        goto out;
 910                }
 911
 912                SCpnt->cmnd[1] |= (unsigned char) ((block >> 16) & 0x1f);
 913                SCpnt->cmnd[2] = (unsigned char) ((block >> 8) & 0xff);
 914                SCpnt->cmnd[3] = (unsigned char) block & 0xff;
 915                SCpnt->cmnd[4] = (unsigned char) this_count;
 916                SCpnt->cmnd[5] = 0;
 917        }
 918        SCpnt->sdb.length = this_count * sdp->sector_size;
 919
 920        /* If DIF or DIX is enabled, tell HBA how to handle request */
 921        if (host_dif || scsi_prot_sg_count(SCpnt))
 922                sd_prot_op(SCpnt, host_dif);
 923
 924        /*
 925         * We shouldn't disconnect in the middle of a sector, so with a dumb
 926         * host adapter, it's safe to assume that we can at least transfer
 927         * this many bytes between each connect / disconnect.
 928         */
 929        SCpnt->transfersize = sdp->sector_size;
 930        SCpnt->underflow = this_count << 9;
 931        SCpnt->allowed = SD_MAX_RETRIES;
 932
 933        /*
 934         * This indicates that the command is ready from our end to be
 935         * queued.
 936         */
 937        ret = BLKPREP_OK;
 938 out:
 939        return scsi_prep_return(q, rq, ret);
 940}
 941
 942/**
 943 *      sd_open - open a scsi disk device
 944 *      @inode: only i_rdev member may be used
 945 *      @filp: only f_mode and f_flags may be used
 946 *
 947 *      Returns 0 if successful. Returns a negated errno value in case 
 948 *      of error.
 949 *
 950 *      Note: This can be called from a user context (e.g. fsck(1) )
 951 *      or from within the kernel (e.g. as a result of a mount(1) ).
 952 *      In the latter case @inode and @filp carry an abridged amount
 953 *      of information as noted above.
 954 *
 955 *      Locking: called with bdev->bd_mutex held.
 956 **/
 957static int sd_open(struct block_device *bdev, fmode_t mode)
 958{
 959        struct scsi_disk *sdkp = scsi_disk_get(bdev->bd_disk);
 960        struct scsi_device *sdev;
 961        int retval;
 962
 963        if (!sdkp)
 964                return -ENXIO;
 965
 966        SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_open\n"));
 967
 968        sdev = sdkp->device;
 969
 970        retval = scsi_autopm_get_device(sdev);
 971        if (retval)
 972                goto error_autopm;
 973
 974        /*
 975         * If the device is in error recovery, wait until it is done.
 976         * If the device is offline, then disallow any access to it.
 977         */
 978        retval = -ENXIO;
 979        if (!scsi_block_when_processing_errors(sdev))
 980                goto error_out;
 981
 982        if (sdev->removable || sdkp->write_prot)
 983                check_disk_change(bdev);
 984
 985        /*
 986         * If the drive is empty, just let the open fail.
 987         */
 988        retval = -ENOMEDIUM;
 989        if (sdev->removable && !sdkp->media_present && !(mode & FMODE_NDELAY))
 990                goto error_out;
 991
 992        /*
 993         * If the device has the write protect tab set, have the open fail
 994         * if the user expects to be able to write to the thing.
 995         */
 996        retval = -EROFS;
 997        if (sdkp->write_prot && (mode & FMODE_WRITE))
 998                goto error_out;
 999
1000        /*
1001         * It is possible that the disk changing stuff resulted in
1002         * the device being taken offline.  If this is the case,
1003         * report this to the user, and don't pretend that the
1004         * open actually succeeded.
1005         */
1006        retval = -ENXIO;
1007        if (!scsi_device_online(sdev))
1008                goto error_out;
1009
1010        if ((atomic_inc_return(&sdkp->openers) == 1) && sdev->removable) {
1011                if (scsi_block_when_processing_errors(sdev))
1012                        scsi_set_medium_removal(sdev, SCSI_REMOVAL_PREVENT);
1013        }
1014
1015        return 0;
1016
1017error_out:
1018        scsi_autopm_put_device(sdev);
1019error_autopm:
1020        scsi_disk_put(sdkp);
1021        return retval;  
1022}
1023
1024/**
1025 *      sd_release - invoked when the (last) close(2) is called on this
1026 *      scsi disk.
1027 *      @inode: only i_rdev member may be used
1028 *      @filp: only f_mode and f_flags may be used
1029 *
1030 *      Returns 0. 
1031 *
1032 *      Note: may block (uninterruptible) if error recovery is underway
1033 *      on this disk.
1034 *
1035 *      Locking: called with bdev->bd_mutex held.
1036 **/
1037static int sd_release(struct gendisk *disk, fmode_t mode)
1038{
1039        struct scsi_disk *sdkp = scsi_disk(disk);
1040        struct scsi_device *sdev = sdkp->device;
1041
1042        SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_release\n"));
1043
1044        if (atomic_dec_return(&sdkp->openers) == 0 && sdev->removable) {
1045                if (scsi_block_when_processing_errors(sdev))
1046                        scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW);
1047        }
1048
1049        /*
1050         * XXX and what if there are packets in flight and this close()
1051         * XXX is followed by a "rmmod sd_mod"?
1052         */
1053
1054        scsi_autopm_put_device(sdev);
1055        scsi_disk_put(sdkp);
1056        return 0;
1057}
1058
1059static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1060{
1061        struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk);
1062        struct scsi_device *sdp = sdkp->device;
1063        struct Scsi_Host *host = sdp->host;
1064        int diskinfo[4];
1065
1066        /* default to most commonly used values */
1067        diskinfo[0] = 0x40;     /* 1 << 6 */
1068        diskinfo[1] = 0x20;     /* 1 << 5 */
1069        diskinfo[2] = sdkp->capacity >> 11;
1070        
1071        /* override with calculated, extended default, or driver values */
1072        if (host->hostt->bios_param)
1073                host->hostt->bios_param(sdp, bdev, sdkp->capacity, diskinfo);
1074        else
1075                scsicam_bios_param(bdev, sdkp->capacity, diskinfo);
1076
1077        geo->heads = diskinfo[0];
1078        geo->sectors = diskinfo[1];
1079        geo->cylinders = diskinfo[2];
1080        return 0;
1081}
1082
1083/**
1084 *      sd_ioctl - process an ioctl
1085 *      @inode: only i_rdev/i_bdev members may be used
1086 *      @filp: only f_mode and f_flags may be used
1087 *      @cmd: ioctl command number
1088 *      @arg: this is third argument given to ioctl(2) system call.
1089 *      Often contains a pointer.
1090 *
1091 *      Returns 0 if successful (some ioctls return positive numbers on
1092 *      success as well). Returns a negated errno value in case of error.
1093 *
1094 *      Note: most ioctls are forward onto the block subsystem or further
1095 *      down in the scsi subsystem.
1096 **/
1097static int sd_ioctl(struct block_device *bdev, fmode_t mode,
1098                    unsigned int cmd, unsigned long arg)
1099{
1100        struct gendisk *disk = bdev->bd_disk;
1101        struct scsi_disk *sdkp = scsi_disk(disk);
1102        struct scsi_device *sdp = sdkp->device;
1103        void __user *p = (void __user *)arg;
1104        int error;
1105    
1106        SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp, "sd_ioctl: disk=%s, "
1107                                    "cmd=0x%x\n", disk->disk_name, cmd));
1108
1109        error = scsi_verify_blk_ioctl(bdev, cmd);
1110        if (error < 0)
1111                return error;
1112
1113        /*
1114         * If we are in the middle of error recovery, don't let anyone
1115         * else try and use this device.  Also, if error recovery fails, it
1116         * may try and take the device offline, in which case all further
1117         * access to the device is prohibited.
1118         */
1119        error = scsi_nonblockable_ioctl(sdp, cmd, p,
1120                                        (mode & FMODE_NDELAY) != 0);
1121        if (!scsi_block_when_processing_errors(sdp) || !error)
1122                goto out;
1123
1124        /*
1125         * Send SCSI addressing ioctls directly to mid level, send other
1126         * ioctls to block level and then onto mid level if they can't be
1127         * resolved.
1128         */
1129        switch (cmd) {
1130                case SCSI_IOCTL_GET_IDLUN:
1131                case SCSI_IOCTL_GET_BUS_NUMBER:
1132                        error = scsi_ioctl(sdp, cmd, p);
1133                        break;
1134                default:
1135                        error = scsi_cmd_blk_ioctl(bdev, mode, cmd, p);
1136                        if (error != -ENOTTY)
1137                                break;
1138                        error = scsi_ioctl(sdp, cmd, p);
1139                        break;
1140        }
1141out:
1142        return error;
1143}
1144
1145static void set_media_not_present(struct scsi_disk *sdkp)
1146{
1147        if (sdkp->media_present)
1148                sdkp->device->changed = 1;
1149
1150        if (sdkp->device->removable) {
1151                sdkp->media_present = 0;
1152                sdkp->capacity = 0;
1153        }
1154}
1155
1156static int media_not_present(struct scsi_disk *sdkp,
1157                             struct scsi_sense_hdr *sshdr)
1158{
1159        if (!scsi_sense_valid(sshdr))
1160                return 0;
1161
1162        /* not invoked for commands that could return deferred errors */
1163        switch (sshdr->sense_key) {
1164        case UNIT_ATTENTION:
1165        case NOT_READY:
1166                /* medium not present */
1167                if (sshdr->asc == 0x3A) {
1168                        set_media_not_present(sdkp);
1169                        return 1;
1170                }
1171        }
1172        return 0;
1173}
1174
1175/**
1176 *      sd_check_events - check media events
1177 *      @disk: kernel device descriptor
1178 *      @clearing: disk events currently being cleared
1179 *
1180 *      Returns mask of DISK_EVENT_*.
1181 *
1182 *      Note: this function is invoked from the block subsystem.
1183 **/
1184static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing)
1185{
1186        struct scsi_disk *sdkp = scsi_disk(disk);
1187        struct scsi_device *sdp = sdkp->device;
1188        struct scsi_sense_hdr *sshdr = NULL;
1189        int retval;
1190
1191        SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_check_events\n"));
1192
1193        /*
1194         * If the device is offline, don't send any commands - just pretend as
1195         * if the command failed.  If the device ever comes back online, we
1196         * can deal with it then.  It is only because of unrecoverable errors
1197         * that we would ever take a device offline in the first place.
1198         */
1199        if (!scsi_device_online(sdp)) {
1200                set_media_not_present(sdkp);
1201                goto out;
1202        }
1203
1204        /*
1205         * Using TEST_UNIT_READY enables differentiation between drive with
120ef">defo ,enables dif f="+codspai"srdge -ferentiation between drive with
7a href="drivers/scsi/sd.c#L1197" i2="L1120" class="line" name="L1197">119711981197/*_put spuld>   mega jaz 1Ge dilllp: stai"sk events currently being cleared1050,  *ment events currently being cleared1051, 1052         */1189        int eDEV      int eDEVef="+code=out" class="sref">out;
11741199        if (!scsi_block_when_processing_errors(sdp)) {
1189        int 1199  _put_dege  out;
7a href="drivers/scsi/sd.c#L1117" i2="L1121" class="line" name="L1167">1167            int clearing2
1L1201">1201                goto out;
1149scsi_sense_hdr *1199->scsi_sense_hdr *sshdr = ef="++code=out" class="sref">out;
1151        int 1199  test_unit, ->sdkp2
scsi_sense_hdr *out;
1073utopm_put_de    scsi_autopm_png_errors(out;
1202        }
11551066  ent"> ass=execute TUR, L10u19s*     span class="comment">/* medium not present */1147host_bytef="+code=scsi_ahost_bytes="sref">scsi_autopm        int sdp)) {
1148                set_media_not_present(sdkp);
1201                goto out;
1140        2
116111476static int KERN_INFO, scsi_sense_hdr *clearing2
1201                goto out;
11741204        /*
120ef">defF use code=res="coms="cowe haveass=thengnisent"> resentcevice ever comes back online, we11971198         */1199        if (sdkp->media_present2
scsi_ef">host = changed = 12
                sdkp->changed = 12
1201                goto NOT_READY2
1193        /*1194/*1205<       /*120ef">deffffffM     < class="ss="e has f="+codsuldeis di  * SenUNIvice offline in the first place.11971198         */kfreef="+code=scsi_akfree clasO" class="sref">sense_hdr *out;
1151        int 1199host = 1199 *  MEDIA_CHANG  *  MEDIA_CHANG e=cha:="L1172">1172        return 02
  f">host = 1172        return 02
1142        int retval2
11732
11741184static sync_cachef="+code=scsi_auc sync_caches" claef">set_media_not_present(struct scsi_disk *sdkp2
11462
1189scsirecsi_block_when_pretval2
1188        struct scsi_device *sdp = sdkp->device2
1188        struct sense_hdr *device2
11901121        if (!scsi_device_online(1190eDEV      int eDEVef="+code=out" class="sref">out;
1203
1174scsi_autopmsdp)) {
sdp, out;
out;
sdp, out;
1193        /*10501198< Leaveashespantsof  class="commzerog: thndicsuc       /*10511198< flushmmentythingvice offline in the first place.10521198         */1073recsi_block_when_p1199  execute_req href="+code=scsi_deexecute_reqsi_block_when_processing_errors(sdp, sshdr = sense_hdr *sdkp2
sshdr = out;
1167    error < 02
1139                        break2
11732
11081167    sdp)) {
scsi_ecode=s_resulref="+code=set_meecode=s_resulr clasO" class="sref">KERN_INFO, scsi                        break2
1167          _bytef="+code=scsi_a      _bytes="sref">scsi_autopmsdkp2
1132        eecode=s_    struct KERN_INFO, sense_hdr *1153        2
11741199<1174(out;
1172        return 02
1153        2
11491145<>, set_media_not_pref">sdkp->1174sdp)) {
1102        struct scsi_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl clasO" class="sref"fblk_ioctl(1172        return 02
1203
1199<>scsi_disk *sdp)) {
1199<KERN_INFO, dk_ioctl(disk)2
1189ref">sdkpep          goto sdkpep   clasO" class="sref">KERN_INFO, disk)2
11732
1153        2
114911901189CONFIG_COMPAT1190         */1 Tclasge    * Send Sed whe Note:VFS. W  *  cla=scsi pan class="comment">         */*sis spanthengnizhe we goiled. ss="comls di translT_UNITpaths. pan class="comment">         */         */115a>, ompaterror = set_media_not_presing_ef">sdkp->sdksi_disk" class="sref"d_blk_ioctl(bdev,          */1157e=disk" class="sref">disksref">sdp, disk117411583
9a href="3rivers/scsi/sd.c#L1199" i3="L1130" class="line" name="L1188">1188        struct scsblk_ioctl(sdkp = sdkp->device3
1189device3
11611189e="ifyr =  = sdp, disk)3
1167    11741142device3
5a href="3rivers/scsi/sd.c#L1115" i3="L1131" class="line" name="L1155">11551066 pan class="comment">         */1197s then.  y     * If thletviceonc       /*1198< elsentry     usent"is ef="+c.  Also,eL11ef">s then.  y ent"s,eLt       /*1197      * if the t">      uldnd tak" namd w furs directly to mid level, send other10501051         */1121        if (!scsi_block_when_processiblk_ioctl(1190eDEV      int eDEVef="+code=out" class="sref">out3
out3
5a href="3rivers/scsi/sd.c#L1125" i3="L11325 class="line" nae="L1199">1199(sdp)) 3
11891199(sdp, 1145__usese_hdr *diskout3
7a href="3rivers/scsi/sd.c#L1127" i3="L1132" clacode=out" class="sref">out3
1142device3
1153        3
11901066  pan class="comment">         */1052< Leent"> ss="linescsi translT_UNITte=res>    carwoh iitvice offline in the first place.1051         */eIOCTLCMD      int eIOCTLCMDode=d=code=out" class="sref">out3
1153        3
1153        3
7a href="3rivers/scsi/sd.c#L1137" i3="L1133" clacode=out" class="sref">out3
1188sdk_operT_UNIcsi_block_when_psing_ef">sdk_operT_UNIcdr" cO" class="sref"sd_fopt sdp)) 3
 *1201                goto out;
1157e=di_ef">host3/a> = device        goto 1157e=di  pan clas href="+code=sdkp" class=3sref"3sdkp-><        goto 1157e=di< Leent"> DY" class="sref">NOT_READ323="sref">error<        goto , sdks, 1157e=di/*sgetgeo sdk_getgeo 1157e=di">eIOCTLCMf="+codsis edi ude=cd eve3o wow3ringonme="L1190">1190<       <3pan class="comment">/*sdp, sdksi_disk" class="slass="line" name="L1157">1157e=di     3
7a    < class="ss="e has f="3codsu34="L1133" clacode=out" class="sref">out>sdkp-&        goto gensk" clongs=(genlass="line" name="L1157">1157e=di8         */-><        goto dk_ioctl(k" clong(genlass="line" name="L1157">1157e=dihdr *<_akfree clasO" class="sre3">sen341                goto (1157e=d     int <3 href="+code= ere="L1199"31199<3ef">hoclacode=out" class="sref">out = <3 href="+code=sdp" class="3r>dev351" class="line"e="L1189">1189      3 int 11972
             dk_eh_a>
1197">eIOCTLCM2rivers/scsi/sd.c#L1155" 32="L135_UNITpaths. pan class="commentttttt@scmd:k" clongs=sd-issuref"scsi/sdleareiver*/1197<       <3"+code=scsi_auc sync_cach3s" cl35rivers/scsi/sd.c#L1206" i3="Ltttttt@eh_cmnd:k" clonTers/scsi/sdfirst ahrefnt du hres/scsi/handlc#L131" class="line" name="L1197">1197     3
7a "2rivers/scsi/sd.c#L1157"3i2="L35ts - check media events
1197
1050        s3ruct 1050hdr *
/*10501050 = <3 (!/*1197eDEV3f="+c36nction is invoked from the block sustorscsi/sdh_cmnd.nTerssd_whe1197             pcomscsi/sdh_+cop1133" class="line" name="L1183">1051set_media_not_present(struceh_a>

((disk1174out href="+code=scsdh_cmnd="sref">diskgenlass="line" name="L1157">1157e=dode=sdp" c3ass="sref">sdp, (steh_cmnd_len="sref">disk1_not_present(steh_+cop="sref">disk1158sd3, scsi_device *sdkp = scsi_disk(disk);
disk((113>1193 3      /*<360" class="line" name="L1190">11901198<3Leaveashespantsof  class=3commz37evice3
scsi_device_online(1190disk(1190t = <3flushmmentythingvice offl3ne in37"sref">scsi_autop>scsi_device_onlinedisk1198<3pan class="comment">     3   */37e=out" class="sref">out;_present(steh_+cop="sref">disk113>recsi_blo3k_when_p1193794 class="line" nae="L1199">1199<>s3"""""""""e3sdev" class="sD_FLUSH_TIM3OUT1197    1051         3              break2
1051
/*<133" class="line" name="L1183">1051"sref">sd32rivers/scsi/sd.c#L1179" 32="L137f">s then.  y ent"s,eLt       10511193 3en_p1051sdp)) {
disk(scsick_when_p<)27" _ioctl(sdkp2
disk((steh_cmnd_len="sref">disksdkp2
diskgen=out""2rivers/scsi/sd.crive with1158        23changed = 12
<.<_ef="3r_timac_/sd.c#L1143" i2="L12
<.<_ef="3r_timac_/sdss="++eass="line" name=ror" class="sre>""""""""e32rivers/scsi/sd.c#L1185" 32="L13285 class="line" nae="L1199">1199<11741197(11971197sd3"2rivers/scsi/sd.c#L1189"3i2="L38f">s then.  y ent"s,eLt          1051 32rivers/scsi/sd.c#L1190" 32="L138d tak" namd w furs directly to mid le1134" class="line" name=ror" class="sre se39evice3
changed = 12
<.<_ef="3r_timac_/sd.c#L1143" i2="L12
<.<_ef="3r_timac_/sdss="f">sd;device2
diL1"sref"k/a>)) {
2="L_ERRr *diskass="line.O" class="sref"lwnese 1198<3ruct  *"Mace.113>
scsi_autopm_png_90">119lass hrefcss="line" name="L1190">119lass hrefdisk(sshdr = 113si_disk1199<;_present(stFAILErs/scsi/sd.c#L11FAILEr0" class="line" name="Le="L1189">1139ref">sdkp3p          goto sd3pep  3clasO" class="la#="+cf name="L1153">1153  >11732311 2
ut;_present(steh_+cop="sref">disk1133
1153 43
1189CONFIG_4OMPATsdp((disk1158         */eDEV      int eDEVefu2rivers/scs.c#L11u6_UNITlk_ioctl(disk(disksdprq_pos;
disk(114anthengniz4e we goiled. ss="comls di4trans404eDEV      int eDEVefu2rivers/scs.c#L11u6_UNITlk_ioctl(disk(disksdprq_pos;
disk(scsi_bu="3eode=ndisk" classdcsi_bu="3eodisk114a5thengniz4ee=scsi_block_when_peDEVefu2rivers/scs.c#L11u6_UNITlk_ioctl(disk114ompaterror4/a> = disk114o7paterror4/a href="2rivers/scsi/sd.4a>, <4 href="+ce=dis/scsi/sd.c#L1117" i3="L1131" class="line" name="L1197">11973
9a href4"3rivers/scsi/sd.c#L1199"4i3="L40f">s then.  y ent"s,eLt       1050        s4ruct 11971199  teskdisk(disk(disk114lock_when_4e4"ifyr = sdp114si_block_w4en_p1199<>s4>1142dev ef"="+code=scsi_deee")="sref">disk((1158;cla" name="L1153">1153      4> pan clas4="comment">         */1153      4>7paterror4would evemiddlith ief">s 4hen. 417eDEV      int eDEVefinfo_disk(disk(diskass="line.O" class="sref"lwnes4>< elsentr4     usent"is ef="+c.  Al4o,eL141ss="sref">device333333333333333333333333333333ef">sshdr = CSI="L112_BUFFERSIZ=moO" class="sre CSI="L112_BUFFERSIZ=174">ass="line.O" class="sref"lwnes4>        s4    >      * if the t">  4   ul41pan2
disk114>3
scsi_device_onlinfo_disk1158         */1199  test_unit,ut;cla" name="L1153">1153      4>        i4 (!1153      4>i_block_w4eDEV      int eDEV4f="+c42="L1174">1174disk(disk((115811423
5a href="3rivers/sc4i/sd.4#L1125" i3="L11325 cl,ut;cla" name="L1153">1153      4>
(1066disk((device3k_ioctl(disk1201                got4>        34(disk1201                got43
  pan cla4s="comment">         */1199  test_unit, /scsi/sd.c#L1132" i3="L1bL1133"ful ...si/sd.c#L11wan" i3= c#L1flows h1134" class="line" name=ror" class="sr4>< Leent">4ss="linescsi translT_UNIT4e=res43> *eDEVefu2rivers/scs.c#L11u6_UNITlk_ioctl((disk((1201                got43i_block_w4s="comment">         */scsi_autopmdo_disd.c#L1193" i2="Lo_disdisk, 114f">eIOCTLC4D      int eIOCTLC4Dode=43L1125" i3="L11325 cl,ef">scsi_autopmdo_disd.c#L1193" i2="Lo_disdisk, 114f
1153 4      3
7a4href="3rivers/scsi/sd.c#L4137" 43href=a" name="L1153">1153      43
sdk_operT_UNIcsi_block4when_43f">s then.  y ent"s,eLt       1051 *4a h4span cl0 tass="line21401">143d tak" namd w furs directly to mid le1134" class="line" name=ror" class="sr4i_ef">host4/a> = 3
disk(disk(disksd;disk11581199  test_unit,ut;cla" name="L1153">1153      4i< Leent">4DY" class="sref">NOT_READ4244_proca" name="L1153">1153      4i/*/ermshof132" class="line" name="L1050">1050eIOCTLC4f="+codsis edi ude=cd eve4o wow44_UNITpaths. pan class="comme  1051<       <4pan class="comment">/*sdpsdpdisk(disk(disk((1153      4i
(sdp, disk114i8         */1149 *4_akfree clasO" class="sre4">sen440" class="line" name="L1190">11901197 = <4 href="+code=sdp" class="4r>dev45ivers/scsi/sd.c#L1182" id="L1ef="drsd_i/sen- bottomohalf/handlL1:f"3riverw#L1194" lower level131" class="line" name="L1197">11974 int 10512
             @SCpnt:/spa-leveld.c#Lsape=//scsi/sdef"d_bur<.133" class="line" name="L1183">1051">eIOCTLC42rivers/scsi/sd.c#L1155" 42="L145_UNITpaths. pan class="commen133" class="line" name="L1183">1051<       <4"+code=scsi_auc sync_cach4s" cl45rivers/scsi/sd.c#L1206" i3="LttttttNote: potentially=runrs/scswii2="dri1ISR. Must     de=sd.133" class="line" name="L1183">1051     3
7a4"2rivers/scsi/sd.c#L1157"4i2="L45ts - check media events(struci/sef="+code=gendisk" do2
((1158        s4ruct 1188hdr *4ruct scsick_when_p(scsick_when_p1142
sdpsdp(scsick_when_p(1142t = <4 (!(1142< Leent">4eDEV      int eDEV4f="+c46ass="sref">scsi_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl clasO" class="sref"fblk_ioctp" class="sref">sdkpege  Notref="2rivers/scsSCpntmoO" class="sre Cpntsi_d/iblk_ioctl((114a2
disk1153      42
disk1153      42<       <4ck_when_p3
outf="3rivers/scsioref">sdkpege  Noofbl clasO" class="sref"SCpntmoO" class="sre Cpntsi_d/iblk_ioctl((1153      42     3
7a4ass="sref">sdp, 1153      4;
(sdkp2
scsick_when_p<)a" name="L1153">1153      4;        s4, device3k_ioctl(114ahdr *4      /*<460" class="line" name="L1190">11901198<4Leaveashespantsof  class=4commz47evice3
scsick_when_p<)"lass="line.O" class="sref"lwnes4>t = <4flushmmentythingvice offl4ne in47"sref">scsi_autop/a>3k_ioctl(disk((114>1198<4pan class="comment">     4   */47e=out" class="sref">o ef"="+code=scsi_dee hrefdisk1153      4>recsi_blo4k_when_p11947put_device" class="srutop/a>3k_ioctl(disk(disk114>
1149    11901190     3
7a4              break2
 *scsiiecsssref"_re+cod114>
disk        s42rivers/scsi/sd.c#L1179" 42="L147ss="sref">device3k_ioctl( *diL1"sref"k/a>)) {
2="L_INFO0" c>, hdr *4en_p3k namd w fursst1c#L">"k" do2
: sb[re+pc,sk,asc,"134" class="line.O" class="sref"lwnes4i_ecode=s_4esulref="+code=set_meecod4=s_re480an2
"ascq]=%x,%x,%x,%x\n"134" cl,ass="line.O" class="sref"lwnes4>         4_bytef="+code=scsi_a     4_byte48"sref">scsi_autop/a>3ssssssssssssssssssssssssssssse3k href="2rivers/scsi/sd.c#L1183" i2="L1128"         goto scsick_pohrefo 1198<4code=s_    struct 3ssssssssssssssssssssssssssssse3k href="2rivers/scsi/sd.c#L1183" i2="L1128"         goto , recsi_blo4114>""""""""e42rivers/scsi/sd.c#L1185" 42="L148ref="+code=SDlass="line" name="L1149">1149117#3" clacode=out" class="sref">out(scsick_when_p<)"!sk(scsiDRIVER="L1120" cf""sre="sreass="line" name=ror" class="sr4a
scsi_device_onli hrefdisk(disksd4"2rivers/scsi/sd.c#L1189"4i2="L48ss="sref">device3gototf="3rivers/scsiosd.c#L1143" i2="L/sdss="eass="line" name=ror" class="sr4ahdr *42rivers/scsi/sd.c#L1190" 42="L1480" class="line" name="L1190">1190se49evice3
(sdkpege  Note_fbl csref">changed = 12
<.<_ef="3r_timac_/sd.c#L1143" i2="L12
<.<_ef="3r_timac_/sdss="fascla" name="L1153">1153      4 {
1189<4ruct  *
HARDWARE_ERRORut_d:ass="line.O" class="sref"lwnes4>""""""""e4 *MEDIUM_ERRORut_d:ass="line.O" class="sref"lwnes4>i_block_w4de=scsi_block_when_psdpsdp(sdp1149ref">sdkp4p          goto sd4pep  49+co{ 0 }+code=out" clbreaklass="line" name="Le="L1189">1149
RECOVERED_ERRORut_d:ass="line.O" class="sref"lwnes4>"sref">sd4"2rivers/scsi/sd.c#L1199"4i2="L49ss="sref">device3k_ioctl(sdpsdp(1143
1153
scsiNO="L112ut_d:ass="line.O" class="sref"lwnes5OMPAT1199  test_unit, /scsi/sd.c#L1132" i3="L1T/is1i" cca
as a fass="class_oped i2=", so=ignor.c#t.  An134" class="line.O" class="sref"lwnes5lass="comm5nt">         */1051("k""134" cl,, 115ompaterror5/a> = scsick_when_p1153      5o7paterror5/a href="2rivers/scsi/sd.5a>, <50href="+ce=disk" clongschanged = 12mssd.c#L1129" i3="L12mssd Notref="2rivers/scsSCpntmoO" class="sre Cpntsi_d/iblk_ioctl(disk 0,, 115o8paterror5/2rivers/scsi/sd.c#L1199"5i3="L50ss="sref">device3breaklass="line" name="Le="L1189">11539paterror5/rivers/scsi/sd.c#L1200" 5evice509ut_device" c.c#L1       goto scsi_autop/a>3ssssssssnt sdp(sdp115lock_when_5e51code=s_    struc /a>3breaklass="line" name="Le="L1189">115si_block_w5en_pdev"2rivers ef"="+code=scsi_deescsi/sd.c#L1183" i2="L1128"         goto sdpsdp(sdp115lmpaterror5="comment">         */(s 5hen. 51href="+ce=disk" clong ef"ref="2rivers/scsescsi/sd.c#L1183" i2="L1128"         goto (device33333ref="2rivers/scsoref">sdkpege  Noofbl clask(sdkpege  NoUNMAPbl cl||lk_ioctl(sdkpege  Noofbl clask(ge  NoWRITE_SAME_="bl cl||lk_ioctl(sdkpege  Noofbl clask(ge  NoWRITE_SAMEbl cclass="line" name="" name=ror" c5>        s5    >      * if the t">  5   ul51pan2
disksdkpege  Note_fbl cs=ef">sshdr = <_LBP_DISABL=moO" class="sre <_LBP_DISABL=si_dllass="line" name="Le="L1189">115>115>         */1199  tedefawhe:ass="line.O" class="sref"lwnes5>        i5 (!115>i_block_w5eDEV      int eDEV5f="+c52="L1174">1174lass="line" name="L1149">114911423
5a href="3rivers/sc5i/sd.52_UNITlk_ioctl(5thengniz5>((READ0" cf""sre="srefnt mpaterror5k_when_p(disksshdr =gooc>sdpsdp115>7paterror53rivers/scsi/sd.c#L1128" 53="L1523" class="linconste" name="L1188">15>1142devdif capable(dif capables="sref="2rivers/scssdkpege  Note_fbl c/iblk_ioctl((, sdkpege  Note_fbl c/iblk_ioctl(

15>        s5(gen"!sk(((1189CONFIG_5>  pan cla5s="comment">         */1199  test_unit, /scsi/sd.c#L1132" i3="L1Wcohan2
to sref" a failref"scsi/sdher.cahrf*<133" class="line" name="L1183">1051< Leent">5ss="linescsi translT_UNIT5e=res53   carwoh iitvice offline in the firrrrrrrrr* extendrefCDBrgets frerefbefor.cc+cssio c_dile
1051i_block_w5s="comment">         */1051eIOCTLC5D      int eIOCTLC5Dode=53_UNITpaths. pan class="comme  scsick_when_p<)ass="line" name=ror" class="sr5fmpaterror5href="3rivers/scsi/sd.c#L5137" 53+co{ 0 }+code=out" clllllllllnt 1153
15>1142sdk_operT_UNIcsi_block5when_53ss="sref">device3k_ioctl(gen>, disk1153        s5a h4span cl0 tass="line21501">153pan2
gen"sk(scsiNULL>genlass="line" name="Le="L1189">115i_ef">host5/a> = disk1153      5i  pan cla5 href="+code=sdkp" class=5sref"54>1199  telass="line" name="L1149">11495DY" class="sref">NOT_READ5254_proca" name="L1153">1153      5i/*(sdpsdp115i">eIOCTLC5f="+codsis edi ude=cd eve5o wow54_UNITlass="line" name="L1149">1149/*106611971051         */s then.  y ent"s,eLt     *1134" class="line" name=ror" class="sr5ihdr *5_akfree clasO" class="sre5">sen540" clt_mediavoidass="line" name=ror" class="sr5     int <5 href="+code= ere="L1199"51199<55fline a_spinup_ioct Notrsi_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c)ass="line" name=ror" class="sr5st = <5 href="+code=sdp" class="5r>dev55iverslass="line.O" class="sref"lwnes5s< Leent">5 int  = outf="3rivers/scsiiL1(1153      5>2
(1153      5>">eIOCTLC52rivers/scsi/sd.c#L1155" 52="L1554sdp)) {
(115><       <5"+code=scsi_auc sync_cach5s" cl555vice3
scsifhe_re+cod0" class="line" name="Le="L1189">115>     3
7a5"2rivers/scsi/sd.c#L1157"5i2="L55+co{ 0 }+codeef"d_blk_ioctl(115riecsi_blo5k_when_p)) {
disk1153      5>        s5ruct 1153      5>hdr *5ruct (1153      52
1189CONFIG_52t = <5 (!5eDEV      int eDEV5f="+c56ass="sref">sc /scsi/sd.c#L1132" i3="L1Spinup1needs
to bL1i/senfor modul" loads
too. *1134" class="line" name=ror" class="sr522
dev"2riversf="3rivers/scsiL11rigenlascla" name="L1153">1153      52<       <5ck_when_p1066sdp, (115;        s5, device3"2riversf="3rivers/scsi12mssd.c#L1129" i3="L12mssd Notr(void *) ak2
 0,,9llass="line" name="Le="L1189">115ahdr *5      /*<560" class="line" name="L1190">11901198<5Leaveashespantsof  class=5commz570an2
scsifhe_re+cod0" cisk(sdkpege  Note_fbl c/iblk_ioctl(, t = <5flushmmentythingvice offl5ne in57"sref">scsi_autop/a>333333333333333333333333333333333333333 , scsiNULL>gen> 0,ass="line.O" class="sref"lwnes5>< Leent">5pan class="comment">     5   */57e=out" class="sref">oooooooooooooooooooooooooooooooooooooooak2
sshdr = <_TIMEOUde=SD_MAXentTRIE <_TIMEOUdbl c,ass="line.O" class="sref"lwnes5>2
11957put_device" class="srutop/a>3333333333333333333333333333333 , scsiNULL>genllass="line" name="Le="L1189">115>
1199<    1197     3
7a5              break2
1197iecsi_blo51197        s52rivers/scsi/sd.c#L1179" 52="L157f">s then.  y ent"s,eLt       1051hdr *5en_psdkpege  Note_fbl cs=ak2
scsi_autop/a>3ssssssssssssssssL1128"lass="line" name="Le="L1189">115>1198<5code=s_    struct 1153      5>recsi_blo5scsifhe_re+cod0" c)ass="line" name=ror" class="sr5>
dev"2riversssssssssssssssssf="3rivers/scsis hrefdisk(disk115si_block_w5en_p115s     3
7a5ntk(115siecsi_blo5turn 02
scsi_device_onli+cssstatusfisfgooc="sref">diskscsifhe_re+cod0" c) ||ass="line" name="Le="L1189">115s        s5"2rivers/scsi/sd.c#L1189"5i2="L58ss="sref">device3cccccccccc""="+code=scsi_de class=rcode=sdp" class="s class=rcod/a>)) {
scsifhe_re+cod0" c) ="srefnt scsiDRIVER="L1120" c)f""sre="sreass="line" name=ror" class="sr5ahdr *52rivers/scsi/sd.c#L1190" 52="L158pan2
disk(115 se591" cla#ifdef"Le="L1189">1189CONFIG_5 {
scsi_autop/a>3 ef"ref="2rivers/scs class=rcode=sdp" class="s class=rcod/a>)) {
scsifhe_re+cod0" c) ="srefnt scsiDRIVER="L1120" c)f""20)"lass="line.O" class="sref"lwnes5 1198<5ruct ooooooooo /scsi/sd.c#L1132" i3="L1no d hre, TUR ei/scs suf="edrefor failre134" class="line" name=ror" class="sr5>
dev"2riversssssssssif">scsi_device_onlipintima(diskscsifhe_re+cod0" c))"lass="line.O" class="sref"lwnes5 i_block_w5de=scsi_block_when_pd1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"UnittNot Ready\n"134" clclass="line" name="Le="L1189">115      3
7a5p          goto sd5pep  59+co{ 0 }+code=out" clriversssssssssssf="3rivers/scsis1"sref"_re+codess="sref">scsiidssref"_re+codsdkpege  Note_fbl cs=ef">sshdr =fhe_re+codess="sref">scsifhe_re+cod0" c)lass="line" name="Le="L1189">115 iecsi_blo51149"sref">sd5"2rivers/scsi/sd.c#L1199"5i2="L59ss="sref">device333333333breaklass="line" name="Le="L1189">1153
114911491199  test_unit, /scsi/sd.c#L1132" i3="L134" class="line" name=ror" class="sr6lass="comm6nt">         */1051dev"2rivers ef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl((disk116ompaterror6/a> = 1153      6o7paterror6/a href="2rivers/scsi/sd.6a>, <60href="+ce=disk" clong ef"="+code=scsi_dee hrefdisk(device3k" clong ef"="+code=scsi_deescsi/sd.c#L1183" i2="L1128"         goto scsi_autop/a>3ssssssssssssssssbreakloo /scsi/sd.c#L1132" i3="L1si2ndbyr*1134" class="line" name=ror" class="sr6sass="comm6e61code=s_    struc /a>3k" clong ef"="+code=scsi_deescsi/sd.c#L1183" i2="L1128"         goto dev"2riversssssssss /scsi/sd.c#L1132" i3="L134" class="line" name=ror" class="sr635thengniz63rivers/scsi/sd.c#L1116" 63="L161_UNIT_READY enables differentiation                 * Issuvf"scsi/sdto spin up1""L11rw#L11    ready134" class="line" name=ror" class="sr63mpaterror6="comment">         */s 6hen. 61href="+ce=disk" clongk" clong ef">scsi_device_onlipintima(< elsentr6     usent"is ef="+c.  Al6o,eL161ss="sref">device33333versssssssss ="3rivers/scsis1"sref"k" class="sref">d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"Spinnc#L up1"L11..."134" clclass="line" name="Le="L1189">116>        s6    >      * if the t">  6   ul61pan2
((sdkpege  NoSTART_STOP28" lass="line" name="Le="L1189">116>(         */scsi_autop/a>3ssssssssssssssssf="3rivers/scsi12mssd.c#L1129" i3="L12mssd Notr(void *) ak2
 0,,8class="line" name="Le="L1189">116>        i6 (!(eDEV6f="+c62put_device" class="srutop/a>333333333 ef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl((diskdev"2riversssssssssssssssssssssssss ="3rivers/scsiiL1(116>5thengniz6>(sdkpege  Note_fbl c/iblk_ioctl(, ass="line" name="Le="L1189">116>mpaterror6k_when_p(scsiNULL>gen> 0,oak2
116>7paterror63rivers/scsi/sd.c#L1128" 63="L162href="+ce=disk" ccccccccccccccssssssssssssssssssssssss ="3rivers/scsi <_TIMEOUde=SD_MAXentTRIE <_TIMEOUdbl c,3 ass="line" name="Le="L1189">116>< elsentr6si_block_when_pdevice33333verssssssssssssssssssssssssss ="3rivers/scsiNULLess="sref">scsiNULL>genclass="line" name="Le="L1189">116>        s61163
1163         */1199  test_unit,,,,,,,,,lass="line" name="L1149">1149< Leent">6ss="linescsi translT_UNIT6e=res63e=out" class="sref">ooooooooo /scsi/sd.c#L1132" i3="L1Waitk1lsei_nrnfor next tryr*1134" class="line" name=ror" class="sr6>i_block_w6s="comment">         */3k_ioctl(sdkpege  Nomsleers="sr1000class="line" name="Le="L1189">116f">eIOCTLC6D      int eIOCTLC6Dode=63ss="sref">dev"2riversssssssss _ioctl(sref"k/a>))  namd w fursst1c#L">"."134" clclass="line" name="Le="L1189">116f
106610511142sdk_operT_UNIcsi_block6when_63f">s then.  y ent"s,eLt       1051        s6a h4span cl0 tass="line21601">163d tak" namd w furs directly to mid laaaaaaaa* occurdher..  Itd.c#Lsn">ouacterisediaofspansn3
1051host6/a> = 1199  test_unit,} ess=" ef"="+code=scsi_dee hrefdisk6DY" class="sref">NOT_READ6264code=s_    struc /a>3ssssssssssssssss ="3rivers/scsiiscsi/sd.c#L1183" i2="L1128"         goto (/*eIOCTLC6f="+codsis edi ude=cd eve6o wow64ss="sref">dev"2riversssssssssiff">scsi_device_onlipintima(/*(116i     3
7a6   < class="ss="e has f="6codsu64+co{ 0 }+code=out" clriversssssssssssf="3rivers/scsispintima(116i
1149         */device3"2riversf/scsi/sd.c#L1132" i3="L1Waitk1lsei_nrnfor next tryr*1134" class="line" name=ror" class="sr6ihdr *6_akfree clasO" class="sre6">sen64pan2
sdkpege  Nomsleers="sr1000class="line" name="Le="L1189">116     int <6 href="+code= ere="L1199"61199<650an2
 = <6 href="+code=sdp" class="6r>dev65"sref">scsi_autop/a>3ssssssssn/scsi/sd.c#L1132" i3="L1wesi/sd.c#L11undlasti/sdthe1d hre ef=", so=itd.c#Ls134" class="line" name=ror" class="sr6s< Leent">6 int scsi_device_onlipintima(">eIOCTLC62rivers/scsi/sd.c#L1155" 62="L165ss="sref">dev"2riversssssssssssssssssf="3rivers/scsis1"sref"k" class="sref">d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"UnittNot Ready\n"134" clclass="line" name="Le="L1189">116><       <6"+code=scsi_auc sync_cach6s" cl65sc clasO" class="srefriversssssssssssf="3rivers/scsis1"sref"ss href="+codde=moO" class1"sref"ss href="+sdkpege  Note_fbl cs=ak2
116>     3
7a6"2rivers/scsi/sd.c#L1157"6i2="L65+co{ 0 }+code=out" clriverssslass="line" name="L1149">1149116>        s6ruct device3lass="line" name="L1149">1149 *6ruct 1149(, 1162t = <6 (!11896eDEV      int eDEV6f="+c66ass="sref">sc ef"="+code=scsi_deepintima(diskscsifhe_re+cod0" c))ass="line.O" class="sref"lwnes62">eIOCTLC62rivers/scsi/sd.c#L1165" 62="L166ss="sref">dev"2riversssssssss _ioctl(sref"k/a>))  namd w fursst1c#L">"ready\n"134" clclass="line" name="Le="L1189">1162<       <6ck_when_p1162     3
7a6ass="sref">sdp, (sref"k/a>))  namd w fursst1c#L">"    respped ng...\n"134" clclass="line" name="Le="L1189">1162iecsi_blo62rivers/scsi/sd.c#L1168" 62="L166href="+ce=dislass="line" name="L1149">1149, 1149 *6      /*<660" class="line" name="L1190">11901198<6Leaveashespantsof  class=6commz671" cla#ifdef"Le="L1189">1189CONFIG_6>t = <6flushmmentythingvice offl6ne in67"sref /scsi/sd.c#L1132" i3="L134" class="line" name=ror" class="sr6>< Leent">6pan class="comment">     6   */67   carwoh iitvice offline in* Determommrw#L/scs "L11 supports DatatIntegrity Fiele.133" class="line" name="L1183">10512
11967 href="3rivers/scsi/sd.c#L11*1134" class="line" name=ror" class="sr6>


))si_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sref">disk         3
7a6              break2
((sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(116>iecsi_blo6()lass="line" name="Le="L1189">116>        s62rivers/scsi/sd.c#L1179" 62="L16730" ca" name="L1153">1153      6>hdr *6en_psc ef"="+code=scsi_dee+csss/scsi_srote>

sdkpege  Notepn_p<)f""20l||lref="2rivers/scsbu"dri="sref">disk1153      6i_ecode=s_6esulref="+code=set_meecod6=s_re680an2
116>         6_bytef="+code=scsi_a     6_byte681" class="line"e="L1189">11891198<6code=s_    struct )fas"ref="2rivers/scsbu"dri="sref">disk  ass="line" name=ror" class="sr6>
dev ef"scsi_device_onlfypi/sd.c#L1110" i3typi/a>)faas ="3rivers/scsisdkpege  Note_fbl c/iblk_ioctl(

scsi_device_onlia ref">sdkpege  Note_fbl c/iblk_ioctl(116>     3
7a6ntk(1153      6siecsi_blo6turn 02
(sdkpege  Note_fbl c/iblk_ioctl(

)lass="line" name="Le="L1189">116s        s6"2rivers/scsi/sd.c#L1189"6i2="L6830" ca" name="L1153">1153      6ahdr *62rivers/scsi/sd.c#L1190" 62="L1689ss="sref">sc ef"="+code=scsi_defypi/sd.c#L1110" i3typi/a>)f=blkf se690an2
d1"sref"k/a>)) {
scsi2="L_ERR>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"format
ad
wii2
skscsi_autop/a>3f="2rivers/ namd w fursst1c#L">"srote>
sshdr =fypi/sd.c#L1110" i3typi/a>)class="line" name="Le="L1189">116 1198<6ruct o_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clascla" name="L1153">1153      6>
116>""""""""e6 *devlass="line" name="L1149">11491066sd6pep  69+co{ 0 }+codedif capable(dif capables="sref="2rivers/scssdkpege  Notepn_p(, )c)ass="line.O" class="sref"lwnes6 iecsi_blo6d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl csass="line.O" class="sref"lwnes6         s6"2rivers/scsi/sd.c#L1199"6i2="L69ss="sref">device333333333rs/ namd w fursst1c#L">"Enabi/sg DIF Typi %u srote>
sshdr =fypi/sd.c#L1110" i3typi/a>)class="line" name="Le="L1189">116 hdr *63rivers/scsi/sd.c#L1200" 63="L169pan2
1173
d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl csass="line.O" class="sref"lwnes7311199  test_unit,33333333rs/ namd w fursst1c#L">"Disabi/sg DIF Typi %u srote>
sshdr =fypi/sd.c#L1110" i3typi/a>)class="line" name="Le="L1189">117lass="comm7nt">         */1149  ass="line" name=ror" class="sr7anthengniz7e we goiled. ss="comls di7trans7085 clt_mediavoidsf="3rivers/scsiread_capacity_/scsi/sd.c#L1110" i3read_capacity_/scsi/a>))si_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,aef"d_blk_ioctl((sdkpege  Notepn_p(disksd7rorscsifhe_re+cod0" c)ass="line.O" class="sref"lwnes7o7paterror7/a href="2rivers/scsi/sd.7a>, <70href=lass="line.O" class="sref"lwnes7o8paterror7/2rivers/scsi/sd.c#L1199"7i3="L70ss="sref">devf="3rivers/scsis1"sref"sre+codess="sref">scsiidssref"_re+codsdkpege  Note_fbl cs=ef">sshdr =fhe_re+codess="sref">scsifhe_re+cod0" c)lass="line" name="Le="L1189">117a9paterror7/rivers/scsi/sd.c#L1200" 7evice709ss="sref">sc ef"="+code=scsi_dedclass=rcode=sdp" class="s class=rcod/a>)) {
scsifhe_re+cod0" c) ="srefnt scsiDRIVER="L1120" c)ass="line" name="Le="L1189">117si_block_w7en_psdkpege  Note_fbl cs=a href="2rivers/scsi/sd.c#L1183" i2="L1128" class="line" name="Le="L1189">1173
scsi_aess=ass="line" name="Le="L1189">117sass="comm7e71code=s_    struc /a>3f="3rivers/scsis1"sref"k" class="sref">d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"S hre     available.\n"134" clclass="line" name="Le="L1189">11733ss="comm7en_p  ass="line" name=ror" class="sr7snthengniz7si_block_when_pdev /scsi/sd.c#L1132" i3="L134" class="line" name=ror" class="sr735thengniz73rivers/scsi/sd.c#L1116" 73="L171_UNIT_READY enables differentiation * Set dirty bitkfor removabler
         */1051s 7hen. 71     * If thletviceonc      aaaaaaaa*1134" class="line" name=ror" class="sr7>< elsentr7     usent"is ef="+c.  Al7o,eL171ss="sref">dev ef"="+code=scsi_deearef">sdkpege  Notepn_p()f="sre="sreass="line" name=ror" class="sr7>        s7    >      * if the t">  7   ul71pan2
disk(((sdkpege  Note_fbl cclass="line" name="Le="L1189">117>         */1189        i7 (!eDEV7f="+c72 href="3rivers/scsi/sd.c#L1134" i3="* We usad
to s t 12
1051mpaterror7k_when_p(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clasclo /scsi/sd.c#L1132" i3="L1unknown mappad
to zero - ahrusual
*1134" class="line" name=ror" class="sr7>< elsentr7si_block_when_p1149        s71190(1190         */1199# ef_ioctl(scsi <_BUF_SIZ2" class="line" name="L1190">1190((((((scsi <_BUF_SIZ2" class="line" name="L1190">1190         */1190eIOCTLC7Dode=7385 class="line" nae="L1199">1199<(1199<1153      73
10" i3read_capacity_1ts - )si_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,aef"d_blk_ioctl((sdkpege  Notepn_p1142sdk_operT_UNIcsi_block7when_73ss="sref">device33333versssssssssssssssssssssssssskout_fblk_ioctl(bu"dri="sref">disk        s7a h4span cl0 tass="line21701">173d taklass="line.O" class="sref"lwnes7i_ef">host7/a> = out_ioctl((117i  pan cla7 href="+code=sdkp" class=7sref"74>1199  teef"d_blk_ioctl(117i        i7DY" class="sref">NOT_READ7274code=s_    stdisk1153      7ii_block_w7pan class="comment">/*scsifhe_re+cod0" cla" name="L1153">1153      7inthengniz7f="+codsis edi ude=cd eve7o wow74ss="sref">deved int genl= 3>, genl= _ioctl(1153      7i
/*1153      7impaterror7   < class="ss="e has f="7codsu74+co{ 0 }+codesk1153      7i
1153      7i1142         */1153      7ihdr *7_akfree clasO" class="sre7">sen749ss="sref">sc ef"="+code=scsi_deearef">sdkpege  Notepn_p(10" i3no_read_capacity_="174")ass="line.O" class="sref"lwnes7     int <7 href="+code= ere="L1199"71199<750an2
(scsiEINVALref=la" name="L1153">1153      7st = <7 href="+code=sdp" class="7r>dev751" class="line"e="L1189">11897 int 2
 0,o16class="line" name="Le="L1189">117>">eIOCTLC72rivers/scsi/sd.c#L1155" 72="L175ss="sref">dev"2rivers_ioctl(((1153      7s
(10" i3SAI_READ_CAPACITY_="ref=la" name="L1153">1153      7smpaterror7"2rivers/scsi/sd.c#L1157"7i2="L75+co{ 0 }+code=out" cl_ioctl(((1153      7s
(disk 0,o(117>11421153      7rhdr *7ruct scsifhe_re+cod0" clask_ioctl(sdkpege  Notepn_pscsiDMA_FROM_DEVIC2n_p(disk (1172t = <7 (!scsi_autop/a>3ssssssssssssssssssssssss_ioctl(s ="3rivers/scsiNULLess="sref">scsiNULL>genclass="line" name="Le="L1189">1172< Leent">7eDEV      int eDEV7f="+c76ass="ass="line" name="Le="L1189">11722
sdkpege  Note_fbl cs=ak2
eIOCTLC72rivers/scsi/sd.c#L1165" 72="L176ss="sref">dev"2riversssssssssL1128" -_ioctl(scsiENODEV0" cla" name="L1153">1153      72<       <7ck_when_p1066sdp, scsifhe_re+cod0" c) lass="line.O" class="sref"lwnes72iecsi_blo72rivers/scsi/sd.c#L1168" 72="L176href="+ce=disk" cccccccccccccf="3rivers/scsis hrefdisk(disk117;        s7, device3k" clong ef"="+code=scsi_dee hrefdisk/*<76pan2
(scsi_autop/a>3ssssssssssss="+code=scsi_deescsi/sd.c#L1183" i2="L1128"         goto 1153      7>< Leent">7pan class="comment">     7   */77code=s_    struc /a>3ssssssssssssssss /scsi/sd.c#L1132" i3="L1In11977 href="3rivers/scsi/sd.c#L1111111111111111111111111111111111L1In(scsiEINVALref=la" name="L1153">1153      7>     3
7a7              break2
disk(device33333versssss="+code=scsi_deescsi/sd.c#L1183" i2="L1128"         goto 1153      7>hdr *7en_pal timas,134" class="line" name=ror" class="sr7i_ecode=s_7esulref="+code=set_meecod7=s_re780an2
="3rivers/scsi/sd.c#L1134" i3="rrrrrrrrrrrrrrrrrrrrrrrr* game it one moren">oncer*1134" class="line" name=ror" class="sr7>         7_bytef="+code=scsi_a     7_byte78"sref">scsi_autop/a>3sssssssssssssssseef"--_ioctl(genl=blkf0)a" name="L1153">1153      7>1198<7code=s_    struct 3sssssssssssssssssssssssscontinueeass="line" name=ror" class="sr7>recsi_blo71149
dev"2rivers_ioctl(1066     3
7a7ntk(scsifhe_re+cod0" cl""sre="srefnt genclass="line" name="Le="L1189">117siecsi_blo7turn 02
117s        s7"2rivers/scsi/sd.c#L1189"7i2="L78ss="sref">dev ef"="+code=scsi_defhe_re+codess="sref">scsifhe_re+cod0" c) lass="line.O" class="sref"lwnes7ahdr *72rivers/scsi/sd.c#L1190" 72="L178pan2
d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"READ CAPACITY(16) failed\n"134" clclass="line" name="Le="L1189">117 se790an2
)) sdkpege  Note_fbl cs=ef="2rivers/scssdkpege  Notepn_pdisksshdr =fhe_re+codess="sref">scsifhe_re+cod0" c)lass="line" name="Le="L1189">117          7"2rivers/scsi/sd.c#L1192"7i2="L79"sref">scsi_autop/a>3L1128" -_ioctl(scsiEINVALref=la" name="L1153">1153      7 1198<7ruct 1149
devf="3rivers/scsis ctor_sizi/sd.c#L1110" i3c ctor_siziref=lask_ioctl(disk117     devf="3rivers/scsilbamoO" class="srelbaref=lask_ioctl(disk117      3
7a7p          goto sd7pep  79href=a" name="L1153">1153      7 iecsi_blo7(

)) sdkpege  Note_fbl cs=ef="2rivers/scsbu"dri="sref">disk117         s7"2rivers/scsi/sd.c#L1199"7i2="L7930" ca" name="L1153">1153      7 hdr *73rivers/scsi/sd.c#L1200" 73="L1799ss="sref">sc ef"(siziofref="2rivers/scssdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" c)f""24)l""sre="sref"="+code=scsi_delbamoO" class="srelbaref=liblk"20xffffffffULL)) lass="line.O" class="sref"lwnes83
d1"sref"k/a>)) {
scsi2="L_ERR>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"Too bigkfor t/is1kernel. Use a
"134" class="line.O" class="sref"lwnes8311199  test_unit,33333333e namd w fursst1c#L">"kernelf"scpiled wii2
supportkfor large block
"134" class="line.O" class="sref"lwnes832ooooooooo /scsi/sd.c#Lst1c#L">"
118l3ss="comm8nrivers/scsi/sd.c#L1194" 8cla=s80/a>  execute_req href_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clascla" name="L1153">1153      8anthengniz8e we goiled. ss="comls di8trans80ss="sref">dev"2riversL1128" -_ioctl(scsiEOVERFLOWref=la" name="L1153">1153      835thengniz8ee=scsi_block_when_p1149sd8ror1153      8o7paterror8/a href="2rivers/scsi/sd.8a>, <80href="+ce=dis_/scsi/sd.c#L1132" i3="L1Logical blocks per physical block exponent
*1134" class="line" name=ror" class="sr8o8paterror8/2rivers/scsi/sd.c#L1199"8i3="L80ss="sref">devf="3rivers/scsis1 ref">sdkpege  Note_fbl c/iblk_ioctl(disk1153      8a9paterror8/rivers/scsi/sd.c#L1200" 8evice800" class="line" name="L1190">1190scsi_a       goto diskdisk1153      8sass="comm8e81code=s_    st="+code=scsi_deblk_queue_a hgnment_offssd.c#L1129" i3="Lblk_queue_a hgnment_offssd/a>)) sdkpege  Notepn_p(gen>, 11833ss="comm8en_psdkpege  Note_fbl c/iblk_ioctl(dev"2rivers_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl csass="line.O" class="sref"lwnes8s5thengniz83rivers/scsi/sd.c#L1116" 83="L181sc clasO" class="srefriversssss/ namd w fursst1c#L">"shysical block a hgnment offssd: %u\n"134" cls=ef">sshdr =a hgnmentmoO" class="srea hgnmentref=class="line" name="Le="L1189">11836thengniz8="comment">         */1153      8s7paterror8would evemiddlith ief">s 8hen. 817ut_device" ceef"="+code=scsi_debu"dri="sref">diskdevice3nt sdkpege  Note_fbl c/iblk_ioctl((118>        s8    >      * if the t">  8   ul810" class="line" name="L1190">1190disk         */1199  test_unit,33333333et sdkpege  Note_fbl c/iblk_ioctl((118>        i8 (!118>i_block_w8eDEV      int eDEV8f="+c82/a>  execute_req href_ioctl(disk)) sdkpege  Note_fbl cs=ef="2rivers/scsSD_LBP_WS="comment">10" i3SD_LBP_WS="ref=class="line" name="Le="L1189">118>nthengniz83
5a href="3rivers/sc8i/sd.82ss="sref">devlass="line" name="L1149">11495thengniz8>(1066mpaterror8k_when_p(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clas="+code=scsi_delbamoO" class="srelbaref=l+s1lass="line" name="Le="L1189">118>7paterror83rivers/scsi/sd.c#L1128" 83="L182href="+ce=disL1128"  ="3rivers/scsis ctor_sizi/sd.c#L1110" i3c ctor_siziref=la" name="L1153">1153      8>< elsentr8si_block_when_p1149        s81190))si_disk *sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,aef"d_blk_ioctl((sdkpege  Notepn_p         */scsi_autop/a>3ssssssssssssssssssssssssssssssssskout_fblk_ioctl(bu"dri="sref">disk         */  execute_skout_ioctl((1183nthengniz8D      int eIOCTLC8Dode=83ss="sref">devef"d_blk_ioctl(118f
disk1153      8fmpaterror8href="3rivers/scsi/sd.c#L8137" 836c clasO" clascsifhe_re+cod0" cla" name="L1153">1153      83
genl= 3>, genl= _ioctl(1153      8>1142sdk_operT_UNIcsi_block8when_83ss="sref">devf="3rivers/scsis ctor_tmoO" class="sres ctor_tUNITlnt 1153      8>        s8a h4span cl0 tass="line21801">1839a>  execute_sk1153      8i_ef">host8/a> = 1189CONFIG_8i  pan cla8 href="+code=sdkp" class=8sref"84>1199  tedoflass="line.O" class="sref"lwnes8i        i8DY" class="sref">NOT_READ8284e=out" class="sref">o_ioctl(((1153      8ii_block_w8pan class="comment">/*  execute_req href_ioctl((118inthengniz8f="+codsis edi ude=cd eve8o wow84ss="sref">dev"2rivers_ioctl(disk 0,o8class="line" name="Le="L1189">118i
/*1066(scsifhe_re+cod0" clask_ioctl(sdkpege  Notepn_pscsiDMA_FROM_DEVIC2n_p1066(disk 8,oak2
118i1142         */device33333versssssssssssssssssef="2rivers/scsSD_TIMEOUde=SD_MAXentTRIE <_TIMEOUdbl c,3 s ="3rivers/scsiNULLess="sref">scsiNULL>genclass="line" name="Le="L1189">118ihdr *8_akfree clasO" class="sre8">sen840" class="line" name="L1190">1190sdkpege  Note_fbl cs=ak2
 = <8 href="+code=sdp" class="8r>dev85"sref">scsi_autop/a>3ssssssssL1128" -_ioctl(scsiENODEV0" cla" name="L1153">1153      8s< Leent">8 int 118>2
scsifhe_re+cod0" c) lass="line.O" class="sref"lwnes8>">eIOCTLC82rivers/scsi/sd.c#L1155" 82="L185ss="sref">dev"2riversssssssssef="2rivers/scss hrefdisk(disk118s
disk(1153      8>1142device33333versssssssss /scsi/sd.c#L1132" i3="L1D/scsi L1+e" might occurdse3">al timas,134" class="line" name=ror" class="sr8rhdr *8ruct oncer*1134" class="line" name=ror" class="sr82
(genl=blkf0)a" name="L1153">1153      82t = <8 (!scsi_autop/a>3sssssssssssssssssssssssscontinueeass="line" name=ror" class="sr82< Leent">8eDEV      int eDEV8f="+c86e=out" class="sref">olass="line" name="L1149">1149  execute_req hreff="3rivers/scsiretrigen--eass="line" name=ror" class="sr82">eIOCTLC82rivers/scsi/sd.c#L1165" 82="L18685 class="line" nae="L1199">1199<scsifhe_re+cod0" cl""sre="srefnt genclass="line" name="Le="L1189">1182     3
7a8ass="sref">sdp, 1153      82iecsi_blo82rivers/scsi/sd.c#L1168" 82="L1867ut_device" ceef"="+code=scsi_defhe_re+codess="sref">scsifhe_re+cod0" c) lass="line.O" class="sref"lwnes8;        s8, device3_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"READ CAPACITY failed\n"134" clclass="line" name="Le="L1189">118;hdr *8      /*<86pan2
)) sdkpege  Note_fbl cs=ef="2rivers/scssdkpege  Notepn_pdisksshdr =fhe_re+codess="sref">scsifhe_re+cod0" c)lass="line" name="Le="L1189">118>1198<8Leaveashespantsof  class=8commz870an2
(scsiEINVALref=la" name="L1153">1153      8>t = <8flushmmentythingvice offl8ne in87"sref">scsi_alass="line" name="L1149">1149< Leent">8pan class="comment">     8   */87ass="ass="line" name="Le="L1189">118>2
11987/a>  execute_ ="3rivers/scsis ctor_sizi/sd.c#L1110" i3c ctor_siziref=lask_ioctl(disk118>
devf="3rivers/scsilbamoO" class="srelbaref=lask_ioctl(disk118>    1066     3
7a8              break2
sdkpege  Notepn_p(10" i3no_read_capacity_="174"l""sre="sref"="+code=scsi_delbamoO" class="srelbaref=l="20xffffffff)) lass="line.O" class="sref"lwnes8>iecsi_blo8sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clascla" name="L1153">1153      8>         8_bytef="+code=scsi_a     8_byte88"sref">scsi_autop/a>3f="3rivers/scsis1 ref">sdkpege  Note_fbl c/iblk_ioctl(1153      8>1198<8code=s_    struct 3L1128"  ="3rivers/scsis ctor_sizi/sd.c#L1110" i3c ctor_siziref=la" name="L1153">1153      8>recsi_blo81149
1199<    sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" c)f""24)l""sre="sref"="+code=scsi_delbamoO" class="srelbaref=l="20xffffffff)) lass="line.O" class="sref"lwnes8>     3
7a8ntk((d1"sref"k/a>)) {
scsi2="L_ERR>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"Too bigkfor t/is1kernel. Use a
"134" class="line.O" class="sref"lwnes8siecsi_blo8turn 02
"kernelf"scpiled wii2
supportkfor large block
"134" class="line.O" class="sref"lwnes8s        s8"2rivers/scsi/sd.c#L1189"8i2="L88ss="sref">device33333vers /scsi/sd.c#Lst1c#L">"
118ahdr *82rivers/scsi/sd.c#L1190" 82="L188pan2
sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clascla" name="L1153">1153      8 se890an2
(scsiEOVERFLOWref=la" name="L1153">1153      8          8"2rivers/scsi/sd.c#L1192"8i2="L89"sref">scsi_alass="line" name="L1149">1149<8ruct 118>
sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clas="+code=scsi_delbamoO" class="srelbaref=l+s1lass="line" name="Le="L1189">118>""""""""e8 *devf="3rivers/scsis1 ref">sdkpege  Note_fbl c/iblk_ioctl(1153      8     devL1128"  ="3rivers/scsis ctor_sizi/sd.c#L1110" i3c ctor_siziref=la" name="L1153">1153      8      3
7a8p          goto sd8pep  89href=lass="line" name="L1149">1149118         s8"2rivers/scsi/sd.c#L1199"8i2="L8930" ct_mediaed int d1"try_rc16_first/a>))ef"d_blk_ioctl((sdkpege  Notepn_p<)a" name="L1153">1153      8 hdr *83rivers/scsi/sd.c#L1200" 83="L189d taklass="line.O" class="sref"lwnes93
sdkpege  Notepn_p(hostn_p(1153      9311199  test_unit,L1128" cla" name="L1153">1153      932sdkpege  Notepn_p(try_rc_10_firstn_p<)a" name="L1153">1153      9l3ss="comm9nrivers/scsi/sd.c#L1194" 9cla=s90/a>  execute_req hrefL1128" cla" name="L1153">1153      934ss="comm9n*dev ef"="+code=scsi_deearef">sdkpege  Notepn_p(genl=blkf_ioctl(1153      9l5ss="comm9ne=scsi_block_when_p11936thengniz9e          goto sd9ror
)) sdkpege  Notepn_p<))a" name="L1153">1153      9l7thengniz9ea href="2rivers/scsi/sd.9a>, <90href="+ce=disk" cccccL1128" 1lass="line" name="Le="L1189">11938thengniz9e2rivers/scsi/sd.c#L1199"9i3="L90ss="sref">devL1128" cla" name="L1153">1153      939thengniz9erivers/scsi/sd.c#L1200" 9evice900" cllass="line" name="L1149">11491189CONFIG_93
e91code=="3rivers/scsi/sd.c#L11* read ege  capacity0"4" class="line.O" class="sref"lwnes9s3ss="comm9en_pd1"read_capacity/a>))ef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sref">disk         */s 9hen. 917c clasO" cla1153      938paterror9     usent"is ef="+c.  Al9o,eL191ss="sref">devef"d_blk_ioctl((sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(1153      939thengniz9    >      * if the t">  9   ul91pan2
old_capacityn_psdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" cla" name="L1153">1153      9>1189CONFIG_9>         */1199  te ef"="+code=scsi_deea"try_rc16_first" class="sref">d1"try_rc16_first/a>)) sdkpege  Notepn_p<)) lass="line.O" class="sref"lwnes9>        i9 (!o_ioctl((10" i3read_capacity_="174") sdkpege  Note_fbl cs=ef="2rivers/scssdkpege  Notepn_p(bu"dri="sref">disk1153      9>3ss="comm9eDEV      int eDEV9f="+c92/a>  execute_req href ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=la= -_ioctl(scsiEOVERFLOWref=)ass="line.O" class="sref"lwnes9>nthengniz93
5a href="3rivers/sc9i/sd.92ss="sref">dev"2riversssssssssgotosk_ioctl(1153      9>5ss="comm9>((scsiENODEV0" c)ass="line.O" class="sref"lwnes9>6thengniz9k_when_p1153      9>7paterror93rivers/scsi/sd.c#L1128" 93="L192href="+ce=disk" ccccc ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=l"lt;l0)a" name="L1153">1153      9>< elsentr9si_block_when_pdevice33333vers ioctl(()) sdkpege  Note_fbl cs=ef="2rivers/scssdkpege  Notepn_p(bu"dri="sref">disk1153      9>9thengniz91153      93
1153      93         */scsi_a} else lass="line.O" class="sref"lwnes93        i9ss="linescsi translT_UNIT9e=res93e=out" class="sref">o_ioctl(()) sdkpege  Note_fbl cs=ef="2rivers/scssdkpege  Notepn_p(bu"dri="sref">disk1153      93i_block_w9s="comment">         */  execute_req href ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=la= -_ioctl(scsiEOVERFLOWref=)ass="line.O" class="sref"lwnes93nthengniz9D      int eIOCTLC9Dode=93ss="sref">dev"2riversssssssssgotosk_ioctl(1153      9f
1153      936thengniz9href="3rivers/scsi/sd.c#L9137" 93+co{ 0 }+code=out" clversssssL1128"la" name="L1153">1153      93
sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" c)f=blkf4)l""sre="sreass="line" name=ror" class="sr9>1142sdk_operT_UNIcsi_block9when_93ss="sref">device33333ref="2rivers/scssdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" cl=blkf0xffffffffULL)) lass="line.O" class="sref"lwnes9>        s9a h4span cl0 tass="line21901">193pan2
1153      9i_ef">host9/a> = d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"Very bigks/scsi.
"134" class="line.O" class="sref"lwnes9i  pan cla9 href="+code=sdkp" class=9sref"94"sref">scsi_autop/a>3sssssssssssssssssssssssse namd w fursst1c#L">"Tryc#L
to use READ CAPACITY(16).\n"134" clclass="line" name="Le="L1189">119i        i9DY" class="sref">NOT_READ9294e=out" class="sref">ossssssss_ioctl((10" i3read_capacity_="174") sdkpege  Note_fbl cs=ef="2rivers/scssdkpege  Notepn_p(bu"dri="sref">disk119ii_block_w9pan class="comment">/*  execute_req hrefssssssssdev"2rivers"2riversssssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl csass="line.O" class="sref"lwnes9i
/*"Usc#L
0xffffffff asks/scsi sizi\n"134" clclass="line" name="Le="L1189">119i6thengniz9   < class="ss="e has f="9codsu94+co{ 0 }+code=out" cl"2riversssssssss_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clas1 +f"="+code=scsi_dee ctor_tmoO" class="sres ctor_tUNIT)
0xfffffffflass="line" name="Le="L1189">119i
((119i1142         */device33333versssssssssgotosk_ioctl(1153      9ihdr *9_akfree clasO" class="sre9">sen94pan2
11491149dev95"sref">scsi_alass="line" name="L1149">11499 int 119>2
eIOCTLC92rivers/scsi/sd.c#L1155" 92="L195ss="s="3rivers/scsi/sd.c#L1134" i3="* not pan3highest block
number. 1Some1
9eDEV      int eDEV9f="+c96code=="3rivers/scsi/sd.c#L1134" i3="*1134" class="line" name=ror" class="sr922
sdkpege  Notepn_p(fix_capacityut_de||ass="line" name=ror" class="sr92">eIOCTLC92rivers/scsi/sd.c#L1165" 92="L196ss="sref">dev"2ri"="+code=scsi_deearef">sdkpege  Notepn_p(guess_capacityref=l""sre="sref"="+code=scsi_desdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" cl="sref0x01))) lass="line.O" class="sref"lwnes92<       <9ck_when_pd1"sref"k/a>)) {
scsi2="L_INFO>gen>, sdkpege  Note_fbl cs=e namd w fursst1c#L">"Adjustc#L
t/n3s ctor count "134" class="line.O" class="sref"lwnes92     3
7a9ass="sref">sdp, "from its3reportrgnvalue: %llu\n"134" clsass="line.O" class="sref"lwnes92
(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" cclass="line" name="Le="L1189">119;        s9, device3--_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" cla" name="L1153">1153      9;hdr *9      /*<96pan2
11491198<9Leaveashespantsof  class=9commz971" cla#ifdef"Le="L1189">1189CONFIG_9>t = <9flushmmentythingvice offl9ne in97"srefk_ioctl(1189CONFIG_9>< Leent">9pan class="comment">     9   */97e=out" class= ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=la= 0) lass="line.O" class="sref"lwnes9>2
11997/a>  execute_req href_ioctl(1153      9>
dev"2rivers_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl css_ namd w fursst1c#L">"S ctor sizi 03reportrg, "134" class="line.O" class="sref"lwnes9>    "assumc#L
512.\n"134" clclass="line" name="Le="L1189">119>     3
7a9              break2
1149
119>        s92rivers/scsi/sd.c#L1179" 92="L1978=out" class= ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=l!as512l""sre="sreass="line" name=ror" class="sr9>hdr *9en_pscsi_autop="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=l!as4096l""sre="sreass="line" name=ror" class="sr9i< Leent">9code=s_    struct recsi_blo9d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl css_ namd w fursst1c#L">"Unsupportrgns ctor sizi %d.\n"134" clsass="line.O" class="sref"lwnes9>
dev"2rivers"2riversss="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c ctor_siziref=class="line" name="Le="L1189">119>         3
7a9ntk(se990an2
="3rivers/scsi/sd.c#L1134" i3="rrrrrrrr*1134" class="line" name=ror" class="sr9          9"2rivers/scsi/sd.c#L1192"9i2="L99"sref">scsi_autop/a>3f="3rivers/scsis1 ref">sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" clascla" name="L1153">1153      9 1198<9ruct o_/scsi/sd.c#L1132" i3="L134" class="line.O" class="sref"lwnes9>

sd9pep  99+co{ ="3rivers/scsi/sd.c#L1134" i3="""""""""* of twons ctor sizi assumptions134" class="line" name=ror" class="sr9 iecsi_blo9device3_ioctl(1153      9 hdr *93rivers/scsi/sd.c#L1200" 93="L199pan2
1149<203
203
a>  execute_ blk_ioctl(blk_queue_logdial_block_sizi/sd.c#L1110" i3blk_queue_logdial_block_sizi174") sdkpege  Notepn_p(10" i3request_queue>gen>, ss="line" name="L1149">1149<20312031ref=ass="line" name="Le="L1189">12032203/a>  execute_req href">out_ioctl(  [10]s,   [10]la" name="L1153">1153     2034203ss="sref">dev"2rivers_ioctl((sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" cl=lt;"lt;l_ioctl(120352031" class="line" name="L1066">1066<2036s203  >203+co{ 0 }+code=out" cl_ioctl(  sass="line.O" class="sref"lwne2037  )class="line" name="Le="L1189">12038203ss="sref">device3_ioctl(  sass="line.O" class="sref"lwne2039203pan2
  )class="line" name="Le="L1189">1201
20en" class="line" name="L1066">1066<201120e"sref">scsi_autop/a>3eef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl(old_capacityn_psdkpege  Note_fbl c/iblk_ioctl(sdkpege  Nocapacity0" c) lass="line.O" class="sref"lwne20e2ossssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl csass="line.O" class="sref"lwne20e320eine" ne=out" cl"2ridkpege  Note_fbl css_ namd its3repsupport-byte c#L1110 assume: (uppors/uppors)gns ctor sizi %d.\n"134" clsass="linpac153">1153dev"2r" ccccccccccccccssscod>old_capacityn_psdkpege  Note_fbl c/iblk_ioctl(sd#37;d.\n"134" clsass="linpacname="Le="class="sr9s5ss="comm93ri="claapacomment">/*  )class="line" name="L106ref"lwnes936thengniz9="c06refapacdp, 203href="+c"sref">scsi_autop/a>3eef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl(old_capacityn_p174")       938paterror9   ="/a>apac="+code=scsi_8evice85ss="sref">deviceossssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl csass="line.O" class="s/a>      939thengniz9   "s/a>apac/sd.c#L1200"203ri>203pan2
device>="/asd.c#L1200"203ri>203pan2
device<">scsi_autop/a>3eef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl(  )class="line"2name="L10689CONFIG_9>20e93="L199pan2
        i9 (!"sref>="/dkp" class="293="L199pan2
>="/3p, 1153nthengniz9="/coode=sdp" cl8i2="L95/a>  execute_ /scRe/sdl132" i3=13bn3r512-byte unrsstc#L1134" i3="""""""""*1134" class="lin="/name="Le="/a>      9>5ss="comm9>(<="/a>>="/ss="line" nam8="L*/97e=out" class= ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c 1>, 6thengniz9k_w06ref>="/ref="Inef="+c8de=ou88+co{ 0 }+code=out="s)="+code=scsi_desdkpege  Note_fbl c/iblk_ioctl(sdkpege  No= 30" i3iap_st1_=0a>  )class="line"2" class="s/a>      9>7paterror93ri"s/a>>="/vers/scsi/sd2an3
98="L*/97e=out" class= ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c 1>,       9>< elsentr9si_="/a>>="/f="[0]+coe=sd8v" cl86ss="sref">device<="s)="+code=scsi_desdkpege  Note_fbl c/iblk_ioctl(sdkpege  No= 3c ctor_siziref=las512la" name=="/" class="s/a>      9>9thengniz9>="/9ers/scsi/sd2an3
98="L*/97e=out" class= ef"="+code=scsi_dee ctor_sizi/sd.c#L1110" i3c 1>,       93
>="/a="[0]+coe=sd8v" cl86ss="sref">device<="s)="+code=scsi_desdkpege  Note_fbl c/iblk_ioctl(sdkpege  No= ce=disk" cccccL1128" 1lass="lin="/name="L106/a>      93, sdkpege  Note_fbl c/iblk_ioctl(sdkpegepege= ce=disk" cccccL1128" 1lass="lin="/" class="s/a>      93i_block_w9s=""s/a>>="/3p, 1153="/coode=sdp" cl8ss="s89ss="srek_sizi/sd.c/iblk_ioctl((sdkpege  Notepn_p(10">,       9f
>="/omment">/*scsi_autop/a>3eef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl(  )class="line"3name="L106/a>      936thengniz9hre06/a>>="/6oode=sdp" cl8ss="s89ss="sre_psdkpege  Note_fbl c/iblk_ioctl(sdkpege  Notepn_p(>="/vers/93="L199pan2
1142="cla>="/8p,         s9a h"sref>="//sd.c#L1190" 92="L198pan2
=/sci/sL">"bu"dri)1andengot;i3c c#L1134" i3="""""""""*1134" class="lin="4name="Le="/a>      9i_ef">host9/a>="/a>>="/asd.caode=deapacity0" cl=lt;n_ef">hioctl(="/hingvice offl9ne in9sredo_m in_s(devef"d_blk_ioctl(((10">, 119i        i9DY""sL11>="/dkp" class="2020eesdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sr, href="2rissssssssssoctl(devef"d_bm in_efk_ioctl((, 119ii_block_w9pan"sL11>="/ity0"4" clas20d e>20ei9o,eL191ss="sref">devef"d_bs1153="/coodeege  Nocapacity0" c) lass="line.4name="Le="ref"lwnes9i
="/k_when_pdevL1"d_bm in_s(scsi2="L_NOTIC2dbrivers/scsis hredbr(10"">sdkpege  Notepn_p(bu"dri="sr"">sdkpege  Notepoctl(119i6thengniz9   06L11>="/dp, (scsi2="L_NOTIC2dfk_ioctl(, 119i
="/vers/scsi/sd203a >203href="+ce=disk"" i3c+csss/scsi ak2
119i1142="/8ers/93="L199pan2
>="/9p, 1149>="9"sd.c#L1190" 92="L198pan2
=/sL1134" i3="""""""""*1134" class="lin="5name="L1069">1149>="9+code=scsi_de9ice_o96"sref /3riversi so1 L1110" #L11rsst,98="possible -ci/sL">&#L113in pacitvaliefkedkp" ()L1134" i3="""""""""*1134" class="lin="5" class="s9">11499 in"s9">>="9dkp" class="s9ef">e91code=="3ri/sL">"bu"dri)1andengot;ID_BUF_SIZEL1134" i3="""""""""*1134" class="lin="5" class="sL1189">119>2
="9&l=sg"css="li9e" na91 href="3rivers/scsi/sd.c#L11*1134" class="lin="9153">1153">eIOCTLC92ri3="9n_p
="9/sd.c#L1116" 93="L191sc clnti so1#L1110" _flagctl(devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sref">disk6thengniz9"2r06cla>="9        */
="9dlith ief">s 9hen. 917c clasO" cres/a>(1142devef"d_blk_ioctl((sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl( *9ruc"scla>="99 ef="+c.  Al9o,eL191ss="sref">devef"d_bm in_efk_ioctl(="cllith ief">s 9hen. 917c clasO" cpaciwlas ="3rivers/scpaciwlsdkpege  Notepn_psdkpege  Note_fbl i so1#L111as ="3rivers/sci so1#L111#L11c#L1110" i3s/scsi Notla" name=="6name="L106class="sr92  pan cla9 (!06cla>="ci/sd.c#L11922032r>2031ref=ass="line"6" class="sclass="sr92< Leent">9eDE"scla>="cdkp" class="2 i3c ctor_sizir" tdkp" _roivers/scsis ctor_tdkp" _roue_logdial_block_sizi1sdkpege  Note_fbl ck_ioctl(="c/sd.c#L1164" 92="L196put_device" ceef"="+code=scsi_deearef">sdkpege  Notepn_pskip_ms_pagc_3fef"="+code=scsi_kip_ms_pagc_3f="srepege  Nocapacity0" c) lass="line.6153">1153eIOCTLC92ri3="c"sD_FLUSH_TIM9OUTdev"2rivers_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, sdkpege  Note_fbl css_ namdAw fursstW so1 Enve pd">"assumc#L
512.\n"134" clclass="lin="cname="Le="ref"lwnes92<       <9ck_="ref>="ck_when_p="c  break2
="cvers/scsi/sd.9#L11797href=ass="lin="cname="Le="L1189">119;        s9="c/sd.c#L1179" 92="L1978=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_puse_192_bytes_for_3fef"="+code=scsiuse_192_bytes_for_3f="srepege  Nocapacity0" c) lass="line.6" class="s/a>      9;hdr *9   "s/a>>="c/sd.c#L1200"203ri>203. 917c clasO" cres/a>(sdkpege  Notepn_pedo_m in_s(0">0x3F"">sdkpege  Notepn_p(bu"dri="sr""192,ctor_sscsi2="L_NOTIC2dfk_ioctl(sdkpege  NotepNULLioctl(11491198<9Lea="9">>="9" break2
scsi_a} else lass="lin="9name="L10689CONFIG_9>t = <9flu0689C>="9i/sd.c#L1192"9i2="L99"L1190" 92="L198pan2
=/sL1134" i3="""""""""*1134" class="lin="7" class="s89CONFIG_9>< Leent">9pan"s89C>="9t eDEV9f="+c96code=="3rivers/////////* F_sca attempt: askbut w/sL pagcs (0x3F)," i3=#L1134 bytesan3thc#L
i" pan3table.134" class="lin="9" class="sref"lwnes9>2
="9/sd.c#L1194" 92="L199 href="3rivers/scsi/sd.c#Wenumbern3retartri/an3ully: shest block
numson,i/sd.a" clthc#L
i" pan3table.134" class="lin="9153">1153      9>
>="9coode=sdp" cl9ss="s99ss="s="3rivers/scsi/sd.c#ut wmors1rep" 34" vailve pan3thc#L
i" pan3table.134" class="lin="9name="Le="ref"lwnes9>    ="9k_when_p119>     3
7a9   06L11>="9ref="Inef="+c8de=ou88+co{ 0 }+code=ores/a>(sdkpege  Notepn_pedo_m in_s(0">0x3F"">sdkpege  Notepn_p(bu"dri="sr""4,ctor_sscsi2="L_NOTIC2dfk_ioctl(sdkpege  NotepNULLioctl(1149
>="9vers/scsi/sd.9#L11797href=ass="lin="7name="Le="L1189">119>        s92ri="L11>="9f="[0]+coe=sd8v" cl86sL1190" 92="L198pan2
=/sL1134" i3="""""""""*1134" class="lin="7" class="sclass="sr9>hdr *9en_"scla>="9/sd.c#L1190" 92="L198pan2
="3rivers/scsi/sd.c#Second attempt: askbut wpagc 0 W we #L113pagc 0 i ctor sizi assumptions134" class="lin208name="Le="class="sr9i_ecode=s_9esu="cla>="clsd.c#L1190" 92="L198pan2
="3rivers/scsi/sd.c#implpacit;S ca#L1134" iut wpagc 3F mayl8dated8S = <9_by06cla>="c+code=scsi_de9ice_o96"sref /scsi/sd.scsi/sd.c#5: Illegal R1134" ,8S9cod"scla>="ct eDEV9f="+c96code=="3rivers/////////* CDBan3thc#L
i" pan3table.134" class="lin="8" class="sref"lwnes9>recsi_blo9="c/sd.c#L1194" 92="L199 href="3rivers/scsi/sd.crivers/scsi/sd.c#L11*1134" class="lin="8153">1153
="c"sD_FLUSH_TIM9OUTdevef"d_bstatus_is_goorivers/scsis href"d_bstatus_is_goorue_logdial_block_sizres/a>(disk119>    ="comment">/*(sdkpege  Notepn_pedo_m in_s(0">0"">sdkpege  Notepn_p(bu"dri="sr""4,ctor_sscsi2="L_NOTIC2dfk_ioctl(sdkpege  NotepNULLioctl(     3
7a9ntk06ref>="cdp, ="cvers/scsi/sd203a >203sL1190" 92="L198pan2
=/sL1134" i3="""""""""*1134" class="lin="8name="Le="class="sr9s        s9"2r="cla>="ci/sd.c#L1189"9i2="L98ss="s="3rivers/scsi/sd.c#Third attempt: askb255 bytes,quotct oie earlieran3thc#L
i" pan3table.134" class="lin="8" class="sclass="sr9ahdr *92ri"scla>="c/sd.c#L1190" 92="L198pan2
="3rivers/scsi/sd.crivers/scsi/sd.c#L11*1134" class="lin="9name="Le="class="sr9 devef"d_bstatus_is_goorivers/scsis href"d_bstatus_is_goorue_logdial_block_sizres/a>(disk="c=sdkp" class=9sref"94"sref">s+co{ 0 }+code=ores/a>(sdkpege  Notepn_pedo_m in_s(0">0x3F"">sdkpege  Notepn_p(bu"dri="sr""255">, >="cdkp" class="2020ee=out" cccccccccccccccccccccccctor_sscsi2="L_NOTIC2dfk_ioctl(sdkpege  NotepNULLioctl(
="c/sd.c#L1164" 9ef="297+co{ 0 }+codelass="lin="9153">1153
="c4p, ="css="line" nam8="L!1ss="sref">devef"d_bstatus_is_goorivers/scsis href"d_bstatus_is_goorue_logdial_block_sizres/a>(scsi_a} else lass="lin="9name="L106ref"lwnes9      3
7a9p  06ref>="cref="Inef="+c8de=ou88+co{ 0 }+code=outvers_ioctl(d1"sref"k/a>)WARNING href="2ri2="L_NOTICWARNINGsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin="9" class="sclass="sr9 iecsi_blo9="cvers/scsi/sd203a >203href="+ce=ssssssssssssssssssssse namd 4" iWP fail;S carivonlW so1 Enve pd">"assumc#L
512.\n"134" clclass="lin="9name="Le="class="sr9         s9"2r="cla>="cf="[0]+coe=sd9pan3
93"sref">scsi_a} else lass="lin="9" class="s/a>      9 hdr *93ri"s/a>>="c/sd.c#L1200"203ri>203. 917c clasO" c_psdkpege  Note_fbl i so1#L111as ="3rivers/sci so1#L111#L11="sref">d1"sref"dfk_ioctl((1149<203
device tdkp" _roivers/scsis ctor_tdkp" _roue_logdial_block_sizi1sdkpege  Note_fbl ck_ioctl(sdkpege  Note_fbl i so1#L111as ="3rivers/sci so1#L111#L11110" i3c ctor_siziref=la" name==1 1ame="L1119lass="sr9          9"2r01ers/s10/sd.c#L1112"203ri>20e"sref">scsi_autop/a>3eef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl(old_capacityn_psdkpege  Note_fbl i so1#L111as ="3rivers/sci so1#L111#L11193"sref">scsi_a} else lass="lin=1 name="Le=1L1189">12032ossssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, 203"2020ee=out" class="sref">osssssdkpege  Note_fbl i so1#L111as ="3rivers/sci so1#L111#L1111531/a>     2034203e=out" class="sref">ossssssss_ioctl(d1"sref"k/a>)DEBUG href="2ri2="L_NOTICDEBUGsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=1 name="Le=1L1189">12035/*s203  >203c203*<>203e=out" class="sref">ossn_p(bu"dri="sr[10" i3cap_st1_sa>  n_p(bu"dri="sr[10" i3cap_st1_sa>  n_p(bu"dri="sr[20" i3cap_st1_sa>  n_p(bu"dri="sr[3]L
512.\n"134" clclass="lin=117ame="Le=1Llass="sr9 iecsi_blo9120381201
20en" class="line1 name="L1016">1066<2011e91code=="3rsre clntcache_type -ci/sL">&#L113 w fupacitvaliefkedkp" ()L1134" i3="""""""""*1134" class="lin=1O" class="1ref"lwne20e3"bu"dri)1andengot;ID_BUF_SIZEL1134" i3="""""""""*1134" class="lin=1c153">11531class="sr9snthengniz9si_31claap11coode=sdp" cl9ss="s99ss="s="crivers/scsi/sd.c#L11*1134" class="lin=1cname="Le=1class="sr9s5ss="comm93ri=1claap1commenaode=dev9ce" c91ss="st_mediavoidass="lin=1 name="L101ref"lwnes936thengniz9="c01refap1cdposssss clntcache_typectl(devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sref">diskscsi_a} else lass="lin=1cname="Le=1/a>      938paterror9   =1/a>ap1c="+code=scsi_href="2rissssssssssoctl(  res/a>(ap119 ef="+c.  Al9o,eL191ss="sref">devef"d_blk_ioctl((sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(      9>20en" class="line12name="L10189CONFIG_9>        i9 (!"1ref>=1/dkp" class="2href="2rissssssssssm inpagctl(10c#L1110" i3s/scsi Notla" name==12" class="1/a>      9>3ss="comm9eDE"1/a>>=123kp" class="2href="2risssssssssst_sca octl(10c#L1110" i3s/scsi Notla" name==12153">11531ref"lwnes9>nthengniz9=1/coode=sdp" cl9o,eL191ss="sref">devef"d_bm in_efk_ioctl(      9>5ss="comm9>(<=1/a>>=1/ss="line" nam9o,eL191ss="sref">devef"d_bsdevefak2
6thengniz9k_w01ref>=1/ref="Inef="+c9hen. 917c clasO" cpaciwlk_ioctl(sdkpege  Notepn_psdkpege  Note_fbl W>=12dlith ief">s 9hen. 917c clasO" cpacircrivers/scsis hrepacircrsdkpege  Notepn_psdkpege  Note_fbl RCDas ="3rivers/scRCDsrefc#L1110" i3s/scsi Notla" name==1/name="Le=1/a>      9>< elsentr9si_=1/a>>=12="+code=scsi_href="2risssssssssspacidpofu_ioctl(sdkpege  Notepn_psdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsrefc#L1110" i3s/scsi Notla" name==1/" class="1/a>      9>9thengniz9>=129p,       93
>=1/a="[0]+coe=sd="2risssssssssst_sca octl(10f">4c#L1110" i3s/scsi Notla" name==1/name="L101/a>      93sdkpege  Notepn_pskip_ms_pagc_8ef"="+code=scsi_kip_ms_pagc_8#L11193"sref">scsi_a} else lass="lin=13" class="1ref"lwnes93        i9ss="1ref>=1/ translT_UNIT9e=res9392="L196put_device" ceef"="+code=scsi_deearef">sdkpege  Notepn_ptypectl((disk>=13/sd.c#L1194"203ri>203"202goto1scsi2="L_NOTIC2defaults/a>(11531ref"lwnes93nthengniz9D  31ref>=13coode=sdp" c203*<>203an3
93"sref">scsi_a} else lass="lin=13name="Le=1/a>      9f
>=1/omment">/*sdkpege  Notepn_pskip_ms_pagc_3fef"="+code=scsi_kip_ms_pagc_3f="sre"sref">scsi_a} else lass="lin=13name="L101/a>      936thengniz9hre01/a>>=13oto s203  >203c203*<>203e=out"goto1scsi2="L_NOTIC2defaults/a>(>=13vers/scsi/sd203a >203href="+c="2rissssssssssm inpagctl(10kpegx3Fc#L1110" i3s/scsi Notla" name==13name="Le=1class="sr9>1142=1cla>=13="+code=scsi_8evice85ss="sref92="L1978=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_puse_192_bytes_for_3fef"="+code=scsiuse_192_bytes_for_3f="sre#L1110" i3s/scsi Notla" name==13" class="1ref"lwnes9>        s9a h"1ref>=13/sd.c#L1200"203ri>203pan2
(10f">192c#L1110" i3s/scsi Notla" name==14name="Le=1/a>      9i_ef">host9/a>=1/a>>=14asd.c#L1200"203ri>203pan2
=14/sd.c#L1112"203ri>20e93="L199pan2
119i        i9DY""1L11>=1/dkp" class="2}2an3
98="L*/97e=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_ptypectl((scsi_a} else lass="lin=14" class="1L1189">119ii_block_w9pan"1L11>=1/ity0"4" clas20d e>20e="2rissssssssssm inpagctl(10kpe6e  Nocapacity0" clascla" name==14153">11531ref"lwnes9inthengniz9f="31ref>=14"sD_FLUSH_TIM9OUTdev"2dbrivers/scsis hredbr=1/k_when_pscsi_a} else lass="lin=14name="L101L1189">119i6thengniz9   01L11>=1/dp, (10kpe8e  Nocapacity0" clascla" name==14" class="1L1189">119i
=1/vers/scsi/sd203a >203="2rissssssssssdbrivers/scsis hredbr119i1142>=1/9p, 1149>=15a="[0]+coe=sd=L1190" 92="L198pan2
=/sci/utiously askbcrivers/scsi/sd.c#L11*1134" class="lin=15name="L1019">1149>=15/sd.c#L1112"2i3cap_st1_sa>  res/a>(sdkpege  Notepn_pedo_m in_s(="2rissssssssssdbrivers/scsis hredbr(10"">sdkpege  Notepn_p(bu"dri="sr"">sdkpege  Notept_sca octl(10#37;d.\n"134" clsass="linp15" class="19">11499 in"19">>=15dkp" class="2020ee=out" ctor_sscsi2="L_NOTIC2dfk_ioctl(119>2
=153p, 11531class="sr9>">eIOCTLC92ri31cla>=15"sD_FLUSH_TIM92="!1ss="sref">devef"d_bstatus_is_goorivers/scsis href"d_bstatus_is_goorue_logdial_block_sizres/a>(disk
=15omment">/*6thengniz9"2r01cla>=15dp, 
=19dlith ief">s 92="!1ss="sref">devedfk_ioctl((scsi_a} else lass="lin=15name="Le=1class="sr9>1142=15f="[0]+coe=sd8v" cl86ss="sref">devicm inpagctl(10kpe6e  Nocapacity0" clascla" name==19" class="1class="sr9rhdr *9ruc"1cla>=15/sd.c#L1200"203ri>203. 917c clasO" ct_sca octl(10f">ge  Nocapacity0" clascla" name==16name="Le=1class="sr92
=16a="[0]+coe=sd8v" cl86ss="sref">devicesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=16name="L101class="sr92  pan cla9 (!01cla>=161/sd.c#L119929ef="297+co{ 0 }+codelass="lin=16" class="1class="sr92< Leent">9eDE"1cla>=1cdkp" ef="297+co{ 0 }+codelass="lin=16" class="1class="sr922
=1c/sd.c#L1164" =L1190" 92="L198pan2
=/scthat wan2 OK, now askbut w="rrproper3dengot;crivers/scsi/sd.c#L11*1134" class="lin=16153">11531class="sr92">eIOCTLC92ri31cla>=16coode=sdp" cl8ss="s89ss="sreoctl(devedfk_ioctl((=16k_when_p2031" class="line1cname="L101ref"lwnes92     3
7a9ass01ref>=1c  break2
=16vers/scsi/sd.9#L11999href=="3rivers/c#We're&#L113inte_qsted" i3="rrt_sca3="ree bytes,qucblock
an3thc#L
i" pan3table.134" class="lin=1cname="Le=1L1189">119;        s9=16i/sd.c#L1189"9i2="L98ss="s="3rivers/* B o" "rrefk_ cachewpagc rrrrrfige  ut w="rrt_sca320an3thc#L
i" pan3table.134" class="lin=1c" class="1/a>      9;hdr *9   "1/a>>=16/sd.c#L1190" 92="L198pan2
="3rivers/crivers/scsi/sd.c#L11*1134" class="lin=17name="Le=19">11491198<9Lea=19">>=19" break2
(diskt = <9flu0189C>=19i/sd.c#L1192"9i2="L99goto1scsi2="L_NOTIC2bad_s(9pan"189C>=17dkp" class="2an3
98="L*/97e=out" clasoctl((scsi_a} else lass="lin=19" class="1ref"lwnes9>2
=17ity0"4" clas20d e>20e="2rissssssssssssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=19153">11531/a>      9>
>=17di ude=cd eve9o wow94ss="sref">ssssssssssssssssssssse namdefk_  w fuupportrn3rupportrbytesgns ctor sizi &#f="2rissssssssssoctl((    =17omment">/*(deveID_BUF_SIZEl(119>     3
7a9   01L11>=17  break2
1149
>=17dlith ief">s 92="ss="sref">devicm inpagctl(10kppegx3F"tor_spege  L1978=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_puse_192_bytes_for_3fef"="+code=scsiuse_192_bytes_for_3f="sre#L1110" i3s/scsi Notla" name==17name="Le=1L1189">119>        s92ri=1L11>=19f="[0]+coe=sd8v" cl86sss="s89ss="sreoctl(hdr *9en_"1cla>=179p, =18a="[0]+coe=sd=L1190" 92="L198pan2
=/scGeo" "rrefk_ crivers/scsi/sd.c#L11*1134" class="lin=1cname="L101class="sr9it = <9_by01cla>=181ers/scsi/sd292="L196put_device"octl((10e#L1110" i3s/scsi Notla" name==1c" class="1class="sr9i< Leent">9cod"1cla>=18 translT_UNIT9e=res93e=out" class="sres/a>(sdkpege  Notepn_pedo_m in_s(="2rissssssssssdbrivers/scsis hredbr(10"">sdkpege  Notepn_p(bu"dri="sr"">sdkpege  Notepoctl(recsi_blo9=18/sd.c#L1194"203ri>203"2020ee=out"tor_sscsi2="L_NOTIC2dfk_ioctl(11531ref"lwnes9>
=184p, 119>    =1comment">/*(scsi_a} else lass="lin=18name="L101ref"lwnes9>     3
7a9ntk01ref>=18dp, devedfk_ioctl((devedfk_ioctl((=18vers/scsi/sd.9#L11797href=ass="lin=18name="Le=1class="sr9s        s9"2r=1cla>=18f="[0]+coe=sd8v" cl86while"L*/97e=out" claspffse1as ="3rivers/scpffse1#L11k  Noc>sdkpege  Notepoctl(scsi_a} else lass="lin=18" class="1class="sr9ahdr *92ri"1cla>=18/sd.c#L1200"203ri>203pan2
deven_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11]=1clsD_FLUSH_TIM9OUTdeven_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11]=19i/sd.c#L11922032r>2031ref=ass="line19" class="1/a>      9 1198<9ruc"1/a>>=1cdkp" class="2020ee=out" c8="L*/97e=out" claspagc_epn_ef"="+code=scsipagc_epn_#L11kp= 8110" i3first_sca utpagc_epn_ef"="+code=scsipagc_epn_#L11kp= 6e93"sref">scsi_a} else lass="lin=19" class="1ref"lwnes9>
=19/sd.c#L1194"203ri>203"2020ee=out"=L1190" 92="L198pan2
=/scWe're&inte_qsted"#L113in ="rrt_sca33 bytesan3thc#L
i" pan3table.134" class="lin=19153">11531ref"lwnes9>
=19coode=sdp" cl9ss="s99ss="s="3rivers/scsi/sd.................crivers/scsi/sd.c#L11*1134" class="lin=19name="Le=1ref"lwnes9     =19omment">/*(scsi_a} else lass="lin=19name="L101ref"lwnes9      3
7a9p  01ref>=1cref="Inef="+c8de=ou8803ri>203"2020ee=out"=s="sref">devicesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=19" class="1class="sr9 iecsi_blo9=1cvers/scsi/sd203a >203href="+ce=03ri>203"2020ee=out"=sssssssssssssssssssse namdm inwparef9te_ efk_">"assumc#L
512.\n"134" clclass="lin=19name="Le=1class="sr9         s9"2r=1cla>=19="+code=scsi_8evice85ss="srefffffffffffffffffgoto1scsi2="L_NOTIC2defaults/a>(>=1c/sd.c#L1200"203ri>20333333333333333339pan3
93"sref">scsi_a} else lass="lin=2 name="L1129">1149<203
203"2020ee=out"=s="sref">devicm inpagctl(10kpe i3first_sca utpagc_epn_ef"="+code=scsipagc_epn_#L11c#L1110" i3s/scsi Notla" name==2 1ame="L1129lass="sr9          9"2r02ers/s20/sd.c#L1112"203ri>20ess="srefffffffffffffffffgoto1scsi2="L_NOTIC2Pagc_founrivers/scsis hrePagc_founr#L11c#L1110" i3s/scsi Notla" name==2 2ame="L1129a>      9 1198<9ruc"2
203"2029pan3
93"sref">scsi_a} else lass="lin=2 4ame="L1129ef"lwnes9>
203e=out" c0ee=out"=L1190" 92="L198pan2
=/scGorn3r="rrnextwpagc crivers/scsi/sd.c#L11*1134" class="lin=2 name="Le=2L1189">12035/*(disks203  >203c203*<>203e=out" ce=out"="2risssssssssspffse1as ="3rivers/scpffse1#L11k+= 4 +eL*/97e=out" clasn_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11+2]kpege  No 8) +f">disk(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11+3]c#L1110" i3s/scsi Notla" name==2 8ame="Le=2Llass="sr9         s9"2r=2ers/s20="+code=scsi_8evice85ss="srefffffffffan3
98="L!1ss="sref">devefpfef"="+code=scsi_pfsD_FLtor_spege  L1978=out" clasoctl(disk      9 hdr *93ri"2rs/sc20/sd.c#L1200"203ri>2033333333333333333 ce=out"="2risssssssssspffse1as ="3rivers/scpffse1#L11k+= 2 +e1ss="sref">deven_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11+1]c#L1110" i3s/scsi Notla" name==2 name="Le=2L1189">1201
203"202an3
93"sref">scsi_a} else lass="lin=2 name="L1026">1066<201120ess="srefffffffffffffffff=s="sref">devicesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=2O" class="2ref"lwne20e2"assumc#L
512.\n"134" clclass="lin=2O" class="2ref"lwne20e3203"2020ee=out" cccccccgoto1scsi2="L_NOTIC2defaults/a>(11532class="sr9snthengniz9si_32claap21coode=sdp" c203*<>203e=out" c0ee=out"9#L1110" i3s/scsi Notla" name==2cname="Le=2class="sr9s5ss="comm93ri=2claap21omment">/*s203  >2039#L1110" i3s/scsi Notla" name==2c7ame="Le=2ref"lwnes9s7paterror9wou"2refap21vers/scsi/sd.9#L11797href=ass="lin=2cname="Le=2/a>      938paterror9   =2/a>ap21="+code=scsi_8evice8592="ss="sref">devicm inpagctl(10kppegx3Fe93"sref">scsi_a} else lass="lin=2O" class="2/a>      939thengniz9   "2/a>ap21/sd.c#L1200"203ri>203pan2
(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=22name="Le=2/a>      9>203"2020ensssssssssssssssssssse namdpresan2">"assumc#L
512.\n"134" clclass="lin=22name="L10289CONFIG_9>20ess="srefgoto1scsi2="L_NOTIC2defaults/a>(        i9 (!"2ref>=22dkp" class="2020e}2an3
98="LL*/97e=out" clasn_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11]old_capacityn_m inpagctl(10e93"sref">scsi_a} else lass="lin=22" class="2/a>      9>3ss="comm9eDE"2/a>>=22/sd.c#L1194"203ri>203"202kpege  Notepn_pesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=22153">11532ref"lwnes9>nthengniz9=22coode=sdp" c203*<>203e=out" cgoto1scsi2="L_NOTIC2defaults/a>(      9>5ss="comm9>(<=2/a>>=22omment">/*6thengniz9k_w02ref>=2/ref="Inef="+cscsi2="L_NOTIC2Pagc_founrivers/scsis hrePagc_founr#L11:#L1110" i3s/scsi Notla" name==2/7ame="Le=2/a>      9>7paterror93ri"2/a>>=22vers/scsi/sd203a >20392="ss="sref">devicm inpagctl(10kppe8e93"sref">scsi_a} else lass="lin=22name="Le=2/a>      9>< elsentr9si_=2/a>>=22="+code=scsi_8evice85ss="srefscsi2="L_NOTIC2>gen>, sdkpege  Note_fbl Wd1"sref"n_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11 +e2]>=22/sd.c#L1200"203ri>203pan2
sdkpege  Note_fbl RCDas ="3rivers/scRCDsref="sref">d1"sref"n_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11 +e2]      93
>=23a="[0]+coe=sd8v" cl869pan3
93"sref">scsi_a} else lass="lin=2/name="L102/a>      93s+co{ 0 }+code=o>gen>, sdkpege  Note_fbl Wd1"sref"n_p(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11 +e2]sdkpege  Note_fbl RCDas ="3rivers/scRCDsref>=23/sd.c#L1194"203ri>2039#L1110" i3s/scsi Notla" name==23153">11532ref"lwnes93nthengniz9D  32ref>=234p,       9f
>=2/omment">/*sdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsref1ss="sref">devedfk_ioctl((      936thengniz9hre02/a>>=23oto s203  >203"sref">scsi_autop/a>3eef"="+code=scsi_deea ref">sdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsrefdevefpsdkpege  Note_fbl c/iblk_ioctl(sdkpege  Notepn_puse_10_for_rwef"="+code=scsiuse_10_for_rw">10e93"sref">scsi_a} else lass="lin=23" class="2/a>      93
>=23vers/scsi/sd203a >203href="+c="2rissssssssssssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=23name="Le=2class="sr9>1142=2cla>=23="+code=scsi_8evice85ss="sref03href="+c=sssssssssssssssssssse namdUses READ/WRITE(6), disablsst FUA">"assumc#L
512.\n"134" clclass="lin=23" class="2ref"lwnes9>        s9a h"2ref>=23/sd.c#L1200"203ri>203pan2
sdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsref      9i_ef">host9/a>=2/a>>=24asd.c#L1200"203ri>2039#L1110" i3s/scsi Notla" name==24name="L102ref"lwnes9i  pan cla9 hr02ref>=24i/sd.c#L11922032r>2031ref=ass="line24" class="2L1189">119i        i9DY""2L11>=24 translT_UNIT9e=res9392="L196put_device" ceef"="+code=scsi_deea ref">sdkpege  Note_fbl c/iblk_ioctl((old_capacityn_psdkpege  Note_fbl W119ii_block_w9pan"2L11>=2/ity0"4" clas20d e>20e
old_capacityn_psdkpege  Note_fbl RCDas ="3rivers/scRCDsref<10" i3first_sca ut_de|dpofu_ioctl(old_capacityn_psdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsrefef">disk11532ref"lwnes9inthengniz9f="32ref>=24"sD_FLUSH_TIM9OUT(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=24name="Le=2ref"lwnes9i
=24omment">/*119i6thengniz9   02L11>=2/dp, sdkpege  Note_fbl W119i
=2/vers/scsi/sd203a >203IM9OUTsdkpege  Note_fbl RCDas ="3rivers/scRCDsref119i1142sdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsrefscsi_a} else lass="lin=24" class="2/a>      9ihdr *9_ak"2/a>>=24/sd.c#L1200"203ri>2033333333333333333 c:=ssssssssssssssssssssse namddoesn't support DPO or FUA"assumc#L
512.\n"134" clclass="lin=25name="Le=29">1149>=25evice" class20en_>20en" class="line25name="L1029">1149>=25=sdkp" class=9sref"948dated
512.\n"134" clclass="lin=25" class="29">11499 in"29">>=25dkp" class="29#L1110" i3s/scsi Notla" name==25" class="2L1189">119>2
=253p, 11532class="sr9>">eIOCTLC92ri32cla>=25"sD_F"sref">d1"sref"nad_s(
=25omment">/*6thengniz9"2r02cla>=25dp, 10kppepege  Note_fbl ILLEGAL_REQUEST
=25vers/scsi/sd203a scsi2="L_NOTIC2 ak2
10kppegx24"tor_spege  L1978=out" classak2
10kppegx0ef">disk1142=25f="[0]+coe=sd8v" cl86sL1190" 92="L198pan2
=/scInvalie field" i3CDB crivers/scsi/sd.c#L11*1134" class="lin=29" class="2class="sr9rhdr *9ruc"2cla>=25/sd.c#L1200"203ri>203. 917c clasO" cssssss_ioctl(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=26name="Le=2class="sr92
=26a="[0]+coe=sdan3
512.\n"134" clclass="lin=26name="L102class="sr92  pan cla9 (!02cla>=26=sdkp" class=9sref"94kpege  Notepn_pesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=26" class="2class="sr92< Leent">9eDE"2cla>=2cdkp" ef="297+co{ 0 }+codelass="lin=26" class="2class="sr922
=2c/sd.cscsi2="L_NOTIC2defaults/a>(11532class="sr92">eIOCTLC92ri32cla>=26coode=sdp" cl8="L*/97e=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_pwce_default_octl(10e93"sref">scsi_a} else lass="lin=26name="Le=2ref"lwnes92<       <9ck_=2ref>=26omment">/*(d1"sref"k/a>)) {
scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=26name="L102ref"lwnes92     3
7a9ass02ref>=26ref="Inef="+c8de=ou88+co{ 0 }+code=outen>, sdkpege  Note_fbl W=26vers/scsi/sd29pan3
93"sref">scsi_a} else lass="lin=2cname="Le=2L1189">119;        s9=26f="[0]+coe=sd8v" cl86sss="s89ss="sreesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=26" class="2/a>      9;hdr *9   "2/a>>=26/sd.c#L1200"203ri>203. 917c clasO" c_psdkpege  Note_fbl W11491198<9Lea=29">>=29" break2
t = <9flu0289C>=27/sd.c#L1112"2i3cap_st1_sa>  essdkpege  Note_fbl RCDas ="3rivers/scRCDsref9pan"289C>=27dkp" class="2kpege  Notepn_pessdkpege  Note_fbl DPOFUAas ="3rivers/scDPOFUAsref2
=27ity0"9#L1110" i3s/scsi Notla" name==29153">11532/a>      9>
>=274p,     =27ommen=scsi_de9ice_o96"sref /sL1134" i3="""""""""*1134" class="lin=27name="L102L1189">119>     3
7a9   02L11>=27  bre"css="li9e" na91 href="3rThewATO bit" idicates whethe w="rrDIF application tag rrravailve pL1134" i3="""""""""*1134" class="lin=27" class="29">1149
>=27vers/scsi/sd.9#L11999href=="* ut wuse byw="rroperarsst systeman3thc#L
i" pan3table.134" class="lin=27name="Le=2L1189">119>        s92ri=2L11>=27i/sd.c#L1189"9i2="L98ss="s="crivers/scsi/sd.c#L11*1134" class="lin=27" class="2class="sr9>hdr *9en_"2cla>=279p(devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sref">disk=28a="[03"sref">scsi_a} else lass="lin=2cname="L102class="sr9it = <9_by02cla>=281ers/scsi/sd29ref="2rissssssssssres/a>(scsi2="L_NOTIC2pffse1as ="3rivers/scpffse1#L11e  Nocapacity0" clascla" name==2c" class="2class="sr9i< Leent">9cod"2cla>=28 translT_UNIT9o,eL191ss="sref">devef"d_blk_ioctl((sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(recsi_blo9=28/sd.c#L1194"29o,eL191ss="sref">devef"d_bm in_efk_ioctl(11532ref"lwnes9>
=28coode=sdp" cl9o,eL191ss="sref">devef"d_bsdevefak2
119>    =28k_when_p2031" class="line28name="L102ref"lwnes9>     3
7a9ntk02ref>=28dp, sdkpege  Notepn_ptypectl(old_capacityn_TYPE_DISKctl(disk=28vers/scsi/sd203a >2038dated
512.\n"134" clclass="lin=28name="Le=2class="sr9s        s9"2r=2cla>=28f="[0512.\n"134" clclass="lin=28" class="2class="sr9ahdr *92ri"2cla>=28/sd.c#L1200"292="L196put_device" ceef"="+code=scsi_deea ref">sdkpege  Note_fbl protection_typectl(10kppegef">disk=2clsD_FLUSH_TIM9OUT=29i/sd.c#L11922032r>2031ref=ass="line29" class="2/a>      9 1198<9ruc"2/a>>=29dkp" class="2kpege  Notepn_pres/a>(sdkpege  Notepn_"d_bm in_s(d1"sref"i174") 1,egx0a"">sdkpege  Notepn_p(bu"dri="sr""36,lapacity0" cl=ltID_TIMEOUTscsi_a} else lass="lin=29" class="2ref"lwnes9>
=29/sd.c#L1194"203ri>203"2020ee=ouapacity0" cl=ltID_MAX_RETRIES11532ref"lwnes9>
=294p, =29omment">/*devef"d_bstatus_is_goorivers/scsis href"d_bstatus_is_goorue_logdial_block_sizres/a>(devedfk_ioctl((=2cref="Inef="+c8de=1ss="sref">devedfk_ioctl((scsi_a} else lass="lin=29" class="2class="sr9 iecsi_blo9=2cvers/scsi/sd203a >203sss="s89ss="sreesssss_ioctl(d1"sref"k/a>)WARNING href="2ri2="L_NOTICWARNINGsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=29name="Le=2class="sr9         s9"2r=2cla>=29="+code=scsi_8evice85ss="srefffnsssssssssssssssssssse namdgetrsst Control m inwpage fail;S, asivoe nowATO">"assumc#L
512.\n"134" clclass="lin=29" class="2/a>      9 hdr *93ri"2/a>>=299p, 1149<203
disk20ess="srefsss="s89ss="sreesssss_ibsd1"sref"i1ote_fblk_ioctl(tor_sscsi2="L_NOTIC2 ak2

2038dated
512.\n"134" clclass="lin=3 4ame="L1139ef"lwnes9>
120352031" class="line3O6ame="Le=3Lef"lwnes9      3
7a9p  03     30ref="Inef="+cscsi2="L_NOTIC2pffse1as ="3rivers/scpffse1#L11kpe1ss="sref">devedfk_ioctl((devedfk_ioctl(((bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11]scsi_a} else lass="lin=3O9ame="Le=3La>      9 hdr *93ri"3rs/sc30/sd.c#L1200"203ri>203sss="s89ss="sreesssss_ioctl(d1"sref"k/a>)ERR href="2ri2="L_NOTICERRsref">scsi2="L_NOTIC2>gen>, "assumc#L
512.\n"134" clclass="lin=3 name="Le=3L1189">1201
1066<2011(bu"dri="sr[*/97e=out" claspffse1as ="3rivers/scpffse1#L11 +e5]disk11533class="sr9snthengniz9si_33claap31coode=sdp" c203*<>2038dated
512.\n"134" clclass="lin=3 name="Le=3class="sr9s5ss="comm93ri=3claap31k_when_p2031" class="line3c6ame="Le=3ref"lwnes936thengniz9="c03refap31ref="Inef="+cscsi2="L_NOTIC2 ceef"="+code=scsi_deea ref">sdkpege  Note_fbl ATOf"="+code=scsi_ATOsref      938paterror9   =3/a>ap31="+code=scsi_8dated
512.\n"134" clclass="lin=3 9ame="Le=3/a>      939thengniz9   "3/a>ap31/sd.c9#L1110" i3s/scsi Notla" name==32name="Le=3/a>      9>20en" class="line32name="L10389CONFIG_9>        i9 (!"3ref>=32dkp" scsi/sd.9#L11999href=="* ess clnt.c#L11limits - Query disk s/scsi ut wp"""erred I/O sizesan3thc#L
i" pan3table.134" class="lin=32" class="3/a>      9>3ss="comm9eDE"3/a>>=32/sd.cscsi/sd.9#L11999href=="* @disk: disk to queryn3thc#L
i" pan3table.134" class="lin=32153">11533ref"lwnes9>nthengniz9=32coode=sdp" cl9ss="s99ss="s="crivers/scsi/sd.c#L11*1134" class="lin=32name="Le=3/a>      9>5ss="comm9>(<=3/a>>=32ommenaode=dev9ce6sss="s89ss="sreess clnt.c#L11limitstl(devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(disk6thengniz9k_w03ref>=3/ref="3"sref">scsi_a} else lass="lin=3/7ame="Le=3/a>      9>7paterror93ri"3/a>>=32vers/scsi/sd2sdkpege  9ref="2risssssssssssecizi/sze_fblk_ioctlecizi/szsdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(sdkpege  Note_fbl >ecizi/sizee_fblk_ioctlecizi/sizeL1src#L1110" i3s/scsi Notla" name==32name="Le=3/a>      9>< elsentr9si_=3/a>>=32="+code=scsi_const 9ref="2rissssssssssvpd octl(64c#L1110" i3s/scsi Notla" name==329ame="Le=3/a>      9>9thengniz9>=32/sd.c#L1200"2sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="srf">sdkpege  Notepnkmalc#Lfblk_ioctl(kmalc#Llass="sref">d1"sref"vpd octl(scsi2="L_NOTIC2GFP_NOTIELl(      93
>=33evice" class20en_>20en" class="line3/name="L103/a>      93deve">out_fblk_ioctl(bu"dri="srf||c#L11922032r>2031ref=ass="line33" class="3ref"lwnes93        i9ss="3ref>=3/ translT_UNIT9e=rsL1190" 92="L198pan2
=/scBc#L1 Limits VPD"crivers/scsi/sd.c#L11*1134" class="lin=3/" class="3/a>      93i_block_w9s=""3/a>>=33/sd.c#L1194"203ri1ss="sref">devef"d_bget_vpd pagctl(d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Notepn_p(bu"dri="sr"">sdkpege  Notepvpd octl(disk11533ref"lwnes93nthengniz9D  33ref>=33coode=sdp" c203*<>203goto1scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==33name="Le=3/a>      9f
>=33k_when_p2031" class="line3/name="L103/a>      936thengniz9hre03/a>>=33ref="Inef="+cscsi2="L_NOTIC2blk_queue_io_mitl(d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl ck_ioctl(sdkpege  Note_fbl queueoctl(scsi_a} else lass="lin=33" class="3/a>      93
>=33vers/scsi/sd203a >203href="+ccscsi2="L_NOTIC2get_unalpege _beref"lwnes93(bu"dri="sr[6])"* ="2risssssssssssecizi/sze_fblk_ioctlecizi/sz1142=3cla>=33="+code=scsi_scsi2="L_NOTIC2blk_queue_io_op1as ="3rivers/scblk_queue_io_op1lass="sref">d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl ck_ioctl(sdkpege  Note_fbl queueoctl(scsi_a} else lass="lin=339ame="Le=3ref"lwnes9>        s9a h"3ref>=33/sd.c#L1200"203ri>203pan2
(bu"dri="sr[12])"* ="2risssssssssssecizi/sze_fblk_ioctlecizi/sz      9i_ef">host9/a>=3/a>>=34evice" class20en_>20en" class="line34name="L103ref"lwnes9i  pan cla9 hr03ref>=341ers/scsi/sd292="L196put_device"n_p(bu"dri="sr[3]kppegx3ce93"sref">scsi_a} else lass="lin=34" class="3L1189">119i        i9DY""3L11>=34 translT_UNIT9e=res93sdkpege  9ref="2risssssssssslba_coun1as ="3rivers/sclba_coun1="sr"">sdkpege  Notepdesc_coun1as ="3rivers/scdesc_coun1#L11e  Nocapacity0" clascla" name==34" class="3L1189">119ii_block_w9pan"3L11>=343p, 11533ref"lwnes9inthengniz9f="33ref>=34"sD_FLUSH_TIM9OUTd1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl max_wst.c#L1stl(, =34omment">/*old_capacityn_min_not_zerotl(d1"sref"get_unalpege _beclass="sr92(bu"dri="sr[36])""sref">scsi_a} else lass="lin=34name="L103L1189">119i6thengniz9   03L11>=3/dp, 119i
=34vers/scsi/sd.9#L11797href=ass="lin=34name="Le=3L1189">119i1142devef1ote_fblk_ioctl(sdkpege  Note_fbl lbpmeoctl(disk>=34/sd.c#L1200"203ri>20333333333goto1scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==35name="Le=39">1149>=35evice" class20en_>20en" class="line35name="L1039">1149>=35=sdkp" class=9sref"94="2risssssssssslba_coun1as ="3rivers/sclba_coun1="srf">sdkpege  Notepnget_unalpege _beref"lwnes93(bu"dri="sr[20]110" i3c ctor_siziref=la" name==35" class="39">11499 in"39">>=35 translT_UNIT9e=res93>sdkpege  Notepdesc_coun1as ="3rivers/scdesc_coun1#L11f">sdkpege  Notepnget_unalpege _beref"lwnes93(bu"dri="sr[24]110" i3c ctor_siziref=la" name==35" class="3L1189">119>2
=353p, 11533class="sr9>">eIOCTLC92ri33cla>=35"sD_FLUSH_TIM9OUTdisk
=35omment">/*d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl max_unmapt.c#L1stl(sdkpege  Notepnoba_coun1as ="3rivers/sclba_coun1="sr10" i3c ctor_siziref=la" name==35name="L103class="sr9>6thengniz9"2r03cla>=35dp
=35vers/scsi/sd203a lasO"sref">d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl unmaptgranularitysdkpege  Notepnget_unalpege _beref"lwnes93(bu"dri="sr[28]110" i3c ctor_siziref=la" name==35name="Le=3class="sr9>1142=35f="[0512.\n"134" clclass="lin=39" class="3class="sr9rhdr *9ruc"3cla>=35/sd.c#L1200"203ri>20392="L196put_device"n_p(bu"dri="sr[32]=36a="[0]+coe=sd8v" cl8603a lasO"sref">d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl unmaptalpegpan2
a href="2riverunmaptalpegpan2="srf">, =36=sdkp" class=9sref"948v" cl8603a lasO"sref">d1"sref"get_unalpege _beref"lwnes93(bu"dri="sr[32])"pege  ~(1kpege  No 31110" i3c ctor_siziref=la" name==36" class="3class="sr92< Leent">9eDE"3cla>=3cdkp" ef="297+co{ 0 }+codelass="lin=36" class="3class="sr922
=36/sd.c#L1194"203ri>2038="L!1ss="sref">devef1ote_fblk_ioctl(sdkpege  Note_fbl lbpvpeas ="3rivers/sclbpvpetran)"{rsL1190" 92="L198pan2
=/scLBP VPD"page not provide  crivers/scsi/sd.c#L11*1134" class="lin=36153">11533class="sr92">eIOCTLC92ri33cla>=364p, =36omment">/*20392="L196put_device"i1ote_fblk_ioctl(sdkpege  Note_fbl max_unmapt.c#L1stl(=36ref="Inef="+c8de=ou888v" cl8603a lasO"sref">d1"sref"i1_configdkp"careas ="3rivers/scs1_configdkp"carelass="sref">d1"sref"i1ote_fblk_ioctl(=36vers/scsi/sd203a >203href="+can3
512.\n"134" clclass="lin=3cname="Le=3L1189">119;        s9=36f="[0]+coe=sd8v" cl868v" cl8603a lasO"sref">d1"sref"i1_configdkp"careas ="3rivers/scs1_configdkp"carelass="sref">d1"sref"i1ote_fblk_ioctl(>=369p, 11491198<9Lea=39">>=37a="[0]+coe=sd8v" cl869pan3
9303a lasO"L1190" 92="L198pan2
=/scLBP VPD"page tells us what to use crivers/scsi/sd.c#L11*1134" class="lin=39name="L10389CONFIG_9>t = <9flu0389C>=37i/sd.c#L11922032r>2031ref=ass="line37" class="389CONFIG_9>< Leent">9pan"389C>=37 translT_UNIT9e=res9303ri>20392="L196put_device"i1ote_fblk_ioctl(sdkpege  Note_fbl lbpuas ="3rivers/sclbpu="srftor_spege  L1978=out" clasi1ote_fblk_ioctl(sdkpege  Note_fbl max_unmapt.c#L1stl(2
=37/sd.c#L1194"203ri>203"2020ee=out""sref">d1"sref"i1_configdkp"careas ="3rivers/scs1_configdkp"carelass="sref">d1"sref"i1ote_fblk_ioctl(11533/a>      9>
>=37"sD_FLUSH_TIM9OUT(sdkpege  Note_fbl lbpwstl(    =37omment">/*d1"sref"i1_configdkp"careas ="3rivers/scs1_configdkp"carelass="sref">d1"sref"i1ote_fblk_ioctl(119>     3
7a9   03L11>=37ref="Inef="+c8de=ou888v" cl86an3
98="LL196put_device"i1ote_fblk_ioctl(sdkpege  Note_fbl lbpwsL1189">1201 rfirslbpws1a="[0)512.\n"134" clclass="lin=39" class="39">1149
>=37vers/scsi/sd203a >203IM9OUTd1"sref"i1_configdkp"careas ="3rivers/scs1_configdkp"carelass="sref">d1"sref"i1ote_fblk_ioctl(1201 rfirsID_LBP_WSr1119>        s92ri=3L11>=37f="[0]+coe=sd8v" cl868v" cl86an3
512.\n"134" clclass="lin=37" class="3class="sr9>hdr *9en_"3cla>=37/sd.c#L1200"203ri>2033333333333333333"sref">d1"sref"i1_configdkp"careas ="3rivers/scs1_configdkp"carelass="sref">d1"sref"i1ote_fblk_ioctl(1201 rfirsID_LBP_DISABLE=38asd.c#L1200"203ri>2039#L1110" i3s/scsi Notla" name==3cname="L103class="sr9it = <9_by03cla>=38/sd.c#L1112"29#L1110" i3s/scsi Notla" name==3c" class="3class="sr9i< Leent">9cod"3cla>=38dkp" ef="297+co{ 0 }+codelass="lin=38" class="3ref"lwnes9>recsi_blo9=38/sd.c#scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11:#L1110" i3s/scsi Notla" name==38153">11533ref"lwnes9>
=38coode=sdp" clscsi2="L_NOTIC2kfreeoctl(d1"sref"">out_fblk_ioctl(bu"dri="sre10" i3c ctor_siziref=la" name==38name="Le=3L1189">119>    =38k_whe9#L1110" i3s/scsi Notla" name==3cname="L103ref"lwnes9>     3
7a9ntk03ref>=38dp=38vers/scsi/sd.9#L11999href==/ssL1134" i3="""""""""*1134" class="lin=38name="Le=3class="sr9s        s9"2r=3cla>=38i/sd.c#L1189"9i2="L98ss="s="c ess clnt.c#L11Noteacteristics - Query .c#L1 s/s. NoteacteristicsL1134" i3="""""""""*1134" class="lin=38" class="3class="sr9ahdr *92ri"3cla>=38/sd.cscsi/sd.9#L11999href=="* @disk: disk to queryn3thc#L
i" pan3table.134" class="lin=39name="Le=3class="sr9 =3clsD_F=sdp" cl9ss="s99ss="s="crivers/scsi/sd.c#L11*1134" class="lin=39name="L103class="sr9          9"2r03cla>=39i/sd.aode=dev9ce6sss="s89ss="sreess clnt.c#L11Noteacteristicsas ="3rivers/scs1_ clnt.c#L11Noteacteristicslass=9o,eL191ss="sref">devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(disk>=39dkp" 3"sref">scsi_a} else lass="lin=39" class="3ref"lwnes9>
=39/sd.c#L1194"2sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sr10" i3c ctor_siziref=la" name==39153">11533ref"lwnes9>
=39coode=sdp" clscsi2="L_NOTIC2uref"lwnes93=39omment">/*64c#L1110" i3s/scsi Notla" name==39name="L103ref"lwnes9      3
7a9p  03ref>=39dp=3cvers/scsi/sd2bl c,askout_fblk_ioctl(bu"dri="srf">sdkpege  Notepnkmalc#Lfblk_ioctl(kmalc#Llass="sref">d1"sref"vpd octl(scsi2="L_NOTIC2GFP_NOTIELl(=39f="[0512.\n"134" clclass="lin=39" class="3/a>      9 hdr *93ri"3/a>>=39/sd.c#L1200"292="!1ss="sref">deve">out_fblk_ioctl(bu"dri="srf||c#L11922032r>2031ref=ass="line4 name="L1149">1149<203
devef"d_bget_vpd pagctl(d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Notepn_p(bu"dri="sr"">sdkpege  Notepvpd octl(disk
, 
sdkpege  Notepnget_unalpege _beref"lwnes93(bu"dri="sr[4]110" i3c ctor_siziref=la" name==4 name="Le=4L1189">120352031" class="line4O6ame="Le=4Lef"lwnes9      3
7a9p  04     40dp, diskd1"sref"queue_flag_set_unc#L1eeas ="3rivers/scqueue_flag_set_unc#L1eelass="sref">d1"sref"QUEUE_FLAG_NONROTsdkpege  Notepi1ote_fblk_ioctl(sdkpege  Note_fbl ck_ioctl(sdkpege  Note_fbl queueoctl(      9 hdr *93ri"4rs/sc40/sd.c#scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11:#L1110" i3s/scsi Notla" name==4 name="Le=4L1189">1201
(d1"sref"">out_fblk_ioctl(bu"dri="sre10" i3c ctor_siziref=la" name==4 name="L1046">1066<201111534class="sr9snthengniz9si_34claap41coode=sdp" cl9ss="s99ss="s="c ess clnt.c#L11provisionsst - Query provisionsst VPD"pageL1134" i3="""""""""*1134" class="lin=4cname="Le=4class="sr9s5ss="comm93ri=4claap41ommen=scsi_de9ice_o96"sref "* @disk: disk to queryn3thc#L
i" pan3table.134" class="lin=4c6ame="Le=4ref"lwnes936thengniz9="c04refap41  bre"css="li9e" na91 href="3rivers/scsi/sd.c#L11*1134" class="lin=4c7ame="Le=4ref"lwnes9s7paterror9wou"4refap41vers/aode=dev9ce6sss="s89ss="sreess clnt.c#L11provisionsstas ="3rivers/scs1_ clnt.c#L11provisionsstlass=9o,eL191ss="sref">devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(disk      938paterror9   =4/a>ap41="+co3"sref">scsi_a} else lass="lin=4 9ame="Le=4/a>      939thengniz9   "4/a>ap41/sd.c#L1200"2sdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sr10" i3c ctor_siziref=la" name==42name="Le=4/a>      9>810" i3c ctor_siziref=la" name==42name="L10489CONFIG_9>        i9 (!"4ref>=422p, (sdkpege  Note_fbl lbpmeoctl(disk>=42/sd.c#L1194"203ri>2038dated
512.\n"134" clclass="lin=42153">11534ref"lwnes9>nthengniz9=424p,       9>5ss="comm9>(<=4/a>>=425="[0]+coe=sdscsi2="L_NOTIC2">out_fblk_ioctl(bu"dri="srf">sdkpege  Notepnkmalc#Lfblk_ioctl(kmalc#Llass="sref">d1"sref"vpd octl(scsi2="L_NOTIC2GFP_NOTIELl(6thengniz9k_w04ref>=42dp      9>7paterror93ri"4/a>>=42vers/scsi/sd292="!1ss="sref">deve">out_fblk_ioctl(bu"dri="srf||i1ss="sref">devef"d_bget_vpd pagctl(d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Notepn_p(bu"dri="sr"">sdkpege  Notepvpd octl(disk      9>< elsentr9si_=4/a>>=42f="[0]+coe=sd8v" cl86goto1scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==429ame="Le=4/a>      9>9thengniz9>=429p,       93
>=43a="[0]+coe=sdscsi2="L_NOTIC2f1ote_fblk_ioctl(sdkpege  Note_fbl lbpvpeas ="3rivers/sclbpvpetrane=sd/a1
512.\n"134" clclass="lin=4/name="L104/a>      93  essdkpege  Note_fbl lbpuas ="3rivers/sclbpu="srf e=sd/a"L196put_device"n_p(bu"dri="sr[5](sdkpege  Note_fbl lbpwstl((bu"dri="sr[5]>=43/sd.c#L1194"2L196put_device"i1ote_fblk_ioctl(sdkpege  Note_fbl lbpwsL1189">1201 rfirslbpws1a="[0=sd/a"L196put_device"n_p(bu"dri="sr[5]11534ref"lwnes93nthengniz9D  34ref>=434p,       9f
>=43k_whe#scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11:#L1110" i3s/scsi Notla" name==4/name="L104/a>      936thengniz9hre04/a>>=43ref="Inef="+cscsi2="L_NOTIC2kfreeoctl(d1"sref"">out_fblk_ioctl(bu"dri="sre10" i3c ctor_siziref=la" name==43" class="4/a>      93
>=43vers/9#L1110" i3s/scsi Notla" name==43name="Le=4class="sr9>1142=4cla>=43f="[0512.\n"134" clclass="lin=439ame="Le=4ref"lwnes9>        s9a h"4ref>=439pdevef"d_blk_ioctl((disk      9i_ef">host9/a>=4/a>>=44a="[03"sref">scsi_a} else lass="lin=44name="L104ref"lwnes9i  pan cla9 hr04ref>=441ers/scsi/sd2=scsi_de9ice_o96"sref /sL1134" i3="""""""""*1134" class="lin=44" class="4L1189">119i        i9DY""4L11>=44dkp" scsi/sd.9#L11999href=="""""""""* Although VPD"inquiries ci/sgo to SCSI-2 type s/scsis,L1134" i3="""""""""*1134" class="lin=44" class="4L1189">119ii_block_w9pan"4L11>=44/sd.cscsi/sd.9#L11999href=="""""""""* some USB ones crash on38dceivsst them, andw="rrpagcsL1134" i3="""""""""*1134" class="lin=44153">11534ref"lwnes9inthengniz9f="34ref>=44coode=sdp" cl9ss="s99ss="s="""""""""* we currs="ly ask ut wari ut wSPC-3 andwbeyondL1134" i3="""""""""*1134" class="lin=44name="Le=4ref"lwnes9i
=44ommen=scsi_de9ice_o96"sref """""""""*rivers/scsi/sd.c#L11*1134" class="lin=44name="L104L1189">119i6thengniz9   04L11>=44dp, sdkpege  Notepn_ps/scsleveltl(psdk kpege  Notepn_pSCSI_SPC_ef"lwnes93por_spege  !1ss="sref">devef1eef"="+code=scsi_deearef">sdkpege  Notepn_pskip_vpd pagcsas ="3rivers/scskip_vpd pagcsdisk119i
=44vers/scsi/sd203a >2038dateda1
512.\n"134" clclass="lin=44name="Le=4L1189">119i1142>=44/sd.c9#L1110" i3s/scsi Notla" name==45name="Le=49">1149>=45evice" class20en_>20en" class="line45name="L1049">1149>=45/sd.c=scsi_de9ice_o96"sref /ssL1134" i3="""""""""*1134" class="lin=45" class="49">11499 in"49">>=45dkp" scsi/sd.9#L11999href=="*      s1_ cvalieatedkp"  - cilledw="rrfirst time a new disk is seen,L1134" i3="""""""""*1134" class="lin=45" class="4L1189">119>2
=45/sd.cscsi/sd.9#L11999href=="*      perut ms disk spin up,  clntcapacity, etcan3thc#L
i" pan3table.134" class="lin=49153">11534class="sr9>">eIOCTLC92ri34cla>=45coode=sdp" cl9ss="s99ss="s="c      @disk: 9o,eL19gendisk we cari abpu1#Lthc#L
i" pan3table.134" class="lin=49name="Le=4class="sr9>
=45ommen=scsi_de9ice_o96"sref "**rivers/scsi/sd.c#L11*1134" class="lin=45name="L104class="sr9>6thengniz9"2r04cla>=45dpdevegendiskf"lwnes93sdkpege ck_ioctl(disk
=45vers/3"sref">scsi_a} else lass="lin=45name="Le=4class="sr9>1142=45="+code=scsi_9o,eL191ss="sref">devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(sdkpege  Notepn_"d_blk_ioctl(( *9ruc"4cla>=45/sd.c#L1200"29o,eL191ss="sref">devef"d_blk_ioctl((sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(=46a="[0]+coe=sdsdkpege  Note_fbl c,askout_fblk_ioctl(bu"dri="sr10" i3c ctor_siziref=la" name==46name="L104class="sr92  pan cla9 (!04cla>=46=sdkp" class=sdkpege  bl c,ask(0e  Nocapacity0" clascla" name==46" class="4class="sr92< Leent">9eDE"4cla>=4cdkp" ef="297+co{ 0 }+codelass="lin=46" class="4class="sr922
=46/sd.c#L1194"2L196put_device"SCSI_LOG_HLQUEUEf"lwnes93sdkpege  Notepi1ssss_ioctl(d1"sref"k/a>)INFOf"="+code=scsi_k/a>)INFO="sr"">sdkpege  Notepi1ote_fblk_ioctl(scsi_a} else lass="lin=46153">11534class="sr92">eIOCTLC92ri34cla>=46"sD_FLUSH_TIM9OUT"assumc#Lee  Nocapacity0" clascla" name==46name="Le=4ref"lwnes92<       <9ck_=4ref>=46k_when_p2031" class="line46name="L104ref"lwnes92     3
7a9ass04ref>=46ref="Inef="+c=scsi_de9ice_o96"sref /sL1134" i3="""""""""*1134" class="lin=46" class="4ref"lwnes92
=46vers/scsi/sd.9#L11999href=="""""""""* Ifw="rrs/scsi is off
119;        s9=46i/sd.c#L1189"9i2="L98ss="s="""""""""* ofw="rro="rr ncsitiesan3thc#L
i" pan3table.134" class="lin=46" class="4/a>      9;hdr *9   "4/a>>=46/sd.cscsi/sd.9#L11999href=="""""""""*rivers/scsi/sd.c#L11*1134" class="lin=47name="Le=49">11491198<9Lea=49">>=47a="[0]+coe=sd8="L!1ss="sref">devef"d_bs/scsi_on1198(d1"sref"i1ote_fblk_ioctl(diskt = <9flu0489C>=47=sdkp" class=9sref"94goto1scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==47" class="489CONFIG_9>< Leent">9pan"489C>=47dkp" ef="297+co{ 0 }+codelass="lin=49" class="4ref"lwnes9>2
=47/sd.c#L1194"2L196put_device"">out_fblk_ioctl(bu"dri="srf">sdkpege  Notepnkmalc#Lfblk_ioctl(kmalc#Llass="sref">d1"sref"SD_BUF_SIZE189">1201 rfirsID_BUF_SIZEscsi2="L_NOTIC2GFP_NOTIELl(11534/a>      9>
>=47"sD_FLUSH_TIM92="!1ss="sref">deve">out_fblk_ioctl(bu"dri="sre93"sref">scsi_a} else lass="lin=49name="Le=4ref"lwnes9>    =47omment">/*sdkpege  Notepi1ssss_ioctl(d1"sref"k/a>)WARNING href="2ri2="L_NOTICWARNINGsref">scsi2="L_NOTIC2>gen>, scsi_a} else lass="lin=49name="L104L1189">119>     3
7a9   04L11>=47ref="Inef="+c8de=ou888v" cl86ccnsssssssssssssssssssse namdalc#Lation failure.">"assumc#L
512.\n"134" clclass="lin=49" class="49">1149
>=47vers/scsi/sd203a >203goto1scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==47name="Le=4L1189">119>        s92ri=4L11>=47f="[0]+coe=sd9#L1110" i3s/scsi Notla" name==47" class="4class="sr9>hdr *9en_"4cla>=479p, =48a="[0]+coe=sdscsi2="L_NOTIC2f1_spinupdkp" as ="3rivers/scs1_spinupdkp" lass="sref">d1"sref"i1ote_fblk_ioctl(9cod"4cla>=482ef="Inef="+c=scsi_de9ice_o96"sref /sL1134" i3="""""""""*1134" class="lin=48" class="4ref"lwnes9>recsi_blo9=48/sd.cscsi/sd.9#L11999href=="""""""""* Without mediaw="rri is now clson to1ask; moreo113, some s/scsisL1134" i3="""""""""*1134" class="lin=48153">11534ref"lwnes9>
=48coode=sdp" cl9ss="s99ss="s="""""""""*  clL19badlyM92=we soan3thc#L
i" pan3table.134" class="lin=48name="Le=4L1189">119>    =48ommen=scsi_de9ice_o96"sref """""""""*rivers/scsi/sd.c#L11*1134" class="lin=4cname="L104ref"lwnes9>     3
7a9ntk04ref>=48dp, (sdkpege  Note_fbl mediaef"esan2
a href="2rivermediaef"esan2="sre93"sref">scsi_a} else lass="lin=48" class="4class="sr9siecsi_blo9tur"4cla>=48vers/scsi/sd203a >203sss="s89ss="sreess clntcapacityas ="3rivers/scs1_ clntcapacitylass="sref">d1"sref"i1ote_fblk_ioctl(sdkpege  Notepn_p(bu"dri="srL
512.\n"134" clclass="lin=4cname="Le=4class="sr9s        s9"2r=4cla>=48f="[0512.\n"134" clclass="lin=48" class="4class="sr9ahdr *92ri"4cla>=48/sd.c#L1200"203ri>20392="L196put_device"sd_try_extended_inquiryd1"sref"i1ote_fblk_ioctl(scsi_a} else lass="lin=49name="Le=4class="sr9 =49a="[0]+coe=sd8v" cl8603a lasO"sref">d1"sref"i1s clnt.c#L11provisionsstas ="3rivers/scs1_ clnt.c#L11provisionsstlass="sref">d1"sref"i1ote_fblk_ioctl(=49/sd.c#L1112"203ri>20ess="srefsss="s89ss="sreess clnt.c#L11limitstl(d1"sref"i1ote_fblk_ioctl(>=49 translT_UNIT9e=res9303ri>203sss="s89ss="sreess clnt.c#L11Noteacteristicsas ="3rivers/scs1_ clnt.c#L11Noteacteristicslass="sref">d1"sref"i1ote_fblk_ioctl(
=49/sd.c#L1194"203ri>2039#L1110" i3s/scsi Notla" name==49153">11534ref"lwnes9>
=494p, =49omment">/*sdkpege  Notepi1s clntwritedprotect_flagas ="3rivers/scs1_ clntwritedprotect_flaglass="sref">d1"sref"i1ote_fblk_ioctl(sdkpege  Notepn_p(bu"dri="srL
512.\n"134" clclass="lin=49name="L104ref"lwnes9      3
7a9p  04ref>=49ref="Inef="+c8de=ou88sss="s89ss="sreess clntcache_typeas ="3rivers/scs1_ clntcache_typelass="sref">d1"sref"i1ote_fblk_ioctl(sdkpege  Notepn_p(bu"dri="srL
512.\n"134" clclass="lin=49" class="4class="sr9 iecsi_blo9=49vers/scsi/sd203a >203sss="s89ss="sreess clntapp_tag_owtl(d1"sref"i1ote_fblk_ioctl(sdkpege  Notepn_p(bu"dri="srL
512.\n"134" clclass="lin=49name="Le=4class="sr9         s9"2r=4cla>=49f="[0]+coe=sd9#L1110" i3s/scsi Notla" name==49" class="4/a>      9 hdr *93ri"4/a>>=499p, 1149<203
(sdkpege  Note_fbl first_scatl(0e  Nocapacity0" clascla" name==5 1ame="L1159lass="sr9          9"2r05ers/s50i/sd.c#L11922032r>2031ref=ass="line5 2ame="L1159a>      9 1198<9ruc"5

12035, (sdkpege  Note_fbl WCE189">1201 rfirsWCE="sre93"sref">scsi_a} else lass="lin=5 7ame="Le=5Llass="sr9 iecsi_blo9d1"sref"flustioctl(sdkpege  NotepnREQ_FLUSHioctl((sdkpege  Note_fbl DPOFUAe_fblk_ioctldisk      9 hdr *93ri"5rs/sc50/sd.c#L1200"203ri>20333333333"sref">d1"sref"flustioctl(sdkpege  NotepnREQ_FUAe_fblk_ioctl1201
1066<20112031ref=ass="line5O" class="5ref"lwne20e2(d1"sref"i1ote_fblk_ioctl(sdkpege  Note_fbl ck_ioctl(sdkpege  Note_fbl queueoctl(d1"sref"flustioctl(, 11535class="sr9snthengniz9si_35claap51coode=sdp" clscsi2="L_NOTIC2set_capacityas ="3rivers/scset_capacityclasL*/97e=out" clasck_ioctl(sdkpege  Notepi1ote_fblk_ioctl(sdkpege  Note_fbl capacityas ="3rivers/sccapacityclasL
512.\n"134" clclass="lin=5Oname="Le=5class="sr9s5ss="comm93ri=5claap515="[0]+coe=sdscsi2="L_NOTIC2kfreeoctl(d1"sref"">out_fblk_ioctl(bu"dri="sre10" i3c ctor_siziref=la" name==5c6ame="Le=5ref"lwnes936thengniz9="c05refap51dp      938paterror9   =5/a>ap51="+code=scsi_8dateda0e  Nocapacity0" clascla" name==5 9ame="Le=5/a>      939thengniz9   "5/a>ap51/sd.c9#L1110" i3s/scsi Notla" name==52name="Le=5/a>      9>20en" class="line52name="L10589CONFIG_9>        i9 (!"5ref>=52dkp" scsi/sd.9#L11999href=="*      s1_unc#L1_nat*11_capacity - unc#L1 nat*11 capacitycl134" i3="""""""""*1134" class="lin=52" class="5/a>      9>3ss="comm9eDE"5/a>>=52/sd.cscsi/sd.9#L11999href=="*      @disk: 9o,eL19gendisk to set capacity forcl134" i3="""""""""*1134" class="lin=52153">11535ref"lwnes9>nthengniz9=52coode=sdp" cl9ss="s99ss="s="ccl134" i3="""""""""*1134" class="lin=52name="Le=5/a>      9>5ss="comm9>(<=5/a>>=52ommen=scsi_de9ice_o96"sref "*      Bc#L1 layer cills this function 8="it s/tects that partitionsL1134" i3="""""""""*1134" class="lin=5/name="L105ref"lwnes9>6thengniz9k_w05ref>=52  bre"css="li9e" na91 href="3      on @disk  clLhwbeyondw="rrend ofw="rrs/scsi.  Ifw="rrSCSI hos1#Lthc#L
i" pan3table.134" class="lin=5/7ame="Le=5/a>      9>7paterror93ri"5/a>>=52vers/scsi/sd.9#L11999href=="3      implehrefs ">sdkunc#L1_nat*11_capacity() method,"it's 9rvokedw=o#Lthc#L
i" pan3table.134" class="lin=5/name="Le=5/a>      9>< elsentr9si_=5/a>>=52i/sd.c#L1189"9i2="L98ss="s="c      g*11 it a Notnce to1adjust t"rrs/scsi capacityan3thc#L
i" pan3table.134" class="lin=529ame="Le=5/a>      9>9thengniz9>=52/sd.cscsi/sd.9#L11999href=="*n3thc#L
i" pan3table.134" class="lin=53name="Le=5/a>      93
>=53lsD_F=sdp" cl9ss="s99ss="s="c      CONTEXT:n3thc#L
i" pan3table.134" class="lin=53name="L105/a>      93>=53/sd.caode=dev9ce6sss="s89ss="sreessunc#L1_nat*11_capacityl(devegendiskf"lwnes93sdkpege ck_ioctl(disk11535ref"lwnes93nthengniz9D  35ref>=534pscsi_a} else lass="lin=53name="Le=5/a>      9f
>=535="[0]+coe=sd9o,eL191ss="sref">devef"d_blk_ioctl((sdkpege  Notepn_"d_blk_ioctl((sdkpege  Note_fbl c/iblk_ioctl(      936thengniz9hre05/a>>=53dp>=53vers/scsi/sd292="" i3c+csss/scsi Nevl(sdkpege  Note_fbl hos1l(sdkpege  Note_fbl hos11l(sdkpege  Note_fbl unc#L1_nat*11_capacityl(disk1142=5cla>=53="+code=scsi_8evice85" i3c+csss/scsi Nevl(sdkpege  Note_fbl hos1l(sdkpege  Note_fbl hos11l(sdkpege  Note_fbl unc#L1_nat*11_capacityl((        s9a h"5ref>=53/sd.c9#L1110" i3s/scsi Notla" name==54name="Le=5/a>      9i_ef">host9/a>=5/a>>=54evice" class20en_>20en" class="line54name="L105ref"lwnes9i  pan cla9 hr05ref>=54/sd.c=scsi_de9ice_o96"sref /ssL1134" i3="""""""""*1134" class="lin=54" class="5L1189">119i        i9DY""5L11>=54dkp" scsi/sd.9#L11999href=="*      s1_ut matdkp" _  i9 - ut mat disk   i9L1134" i3="""""""""*1134" class="lin=54" class="5L1189">119ii_block_w9pan"5L11>=54/sd.cscsi/sd.9#L11999href=="*      @p"""ix:ck_w9 p"""ix - ii. e namds1e namd ut wSCSI disksL1134" i3="""""""""*1134" class="lin=54153">11535ref"lwnes9inthengniz9f="35ref>=54coode=sdp" cl9ss="s99ss="s="*      @index:cindex ofw="rrsisk to ut mat k_w9 forcl134" i3="""""""""*1134" class="lin=54name="Le=5ref"lwnes9i
=54ommen=scsi_de9ice_o96"sref "*      @buf: output bu"dri="134" i3="""""""""*1134" class="lin=54name="L105L1189">119i6thengniz9   05L11>=54  bre"css="li9e" na91 href="3      @buflen: length ofw="rroutput bu"dri="134" i3="""""""""*1134" class="lin=54" class="5L1189">119i
=54vers/scsi/sd.9#L11999href=="3="134" i3="""""""""*1134" class="lin=54name="Le=5L1189">119i1142      9ihdr *9_ak"5/a>>=54/sd.cscsi/sd.9#L11999href=="*      27th is sdaa.  T"rr.9#t one ut wtwo lettere  su"dix is sdzz="134" i3="""""""""*1134" class="lin=55name="Le=59">1149>=55lsD_F=sdp" cl9ss="s99ss="s="c      which is followe  by sdaaaan3thc#L
i" pan3table.134" class="lin=55name="L1059">1149>=55/sd.c=scsi_de9ice_o96"sref "3="134" i3="""""""""*1134" class="lin=55" class="59">11499 in"59">>=55dkp" scsi/sd.9#L11999href=="*      This is basicillyr26 basi coun1sst withcone extra 'nil' refryn3thc#L
i" pan3table.134" class="lin=55" class="5L1189">119>2
=55/sd.cscsi/sd.9#L11999href=="*      at t"rrbeginnsst from t"rrsecondwdigit on andwci/sbr="134" i3="""""""""*1134" class="lin=59153">11535class="sr9>">eIOCTLC92ri35cla>=55coode=sdp" cl9ss="s99ss="s="c      s/term
=55ommen=scsi_de9ice_o96"sref "*si/sd29ndex shifte  -1 after clLhwdigit is o96putedan3thc#L
i" pan3table.134" class="lin=55name="L105class="sr9>6thengniz9"2r05cla>=55  bre"css="li9e" na91 href="3n3thc#L
i" pan3table.134" class="lin=55" class="5class="sr9>
=55vers/scsi/sd.9#L11999href=="3      CONTEXT:n3thc#L
i" pan3table.134" class="lin=55name="Le=5class="sr9>1142=55i/sd.c#L1189"9i2="L98ss="s="c      Don't carian3thc#L
i" pan3table.134" class="lin=559ame="Le=5class="sr9rhdr *9ruc"5cla>=55/sd.cscsi/sd.9#L11999href=="*n3thc#L
i" pan3table.134" class="lin=56name="Le=5class="sr92
=56lsD_F=sdp" cl9ss="s99ss="s="c      RETURNS:n3thc#L
i" pan3table.134" class="lin=56name="L105class="sr92  pan cla9 (!05cla>=56/sd.c=scsi_de9ice_o96"sref "c      0 on success, -errno on failure.n3thc#L
i" pan3table.134" class="lin=56" class="5class="sr92< Leent">9eDE"5cla>=56dkp" scsi/sd.9#L11999href=="*rivers/scsi/sd.c#L11*1134" class="lin=56" class="5class="sr922
=56/sd.caode=de9ref="2risssssssssssd_ut matdkp" _  i9l((ofblk_ioctl(bu"clas""9ref="2rissssssssssbuflenfblk_ioctl(bu"oct11535class="sr92">eIOCTLC92ri35cla>=564pscsi_a} else lass="lin=56name="Le=5ref"lwnes92<       <9ck_=5ref>=56omment">/*ssssssssssssssssssssse#39;ze#39;ivers/s - ssssssssssssssssssssse#39;ae#39;ivers/s +a1
512.\n"134" clclass="lin=56name="L105ref"lwnes92     3
7a9ass05ref>=56ref="Inef="+cNote_fbl c,ask(begin="srf">sdkpege  Notepn">ofblk_ioctl(bu"clas +a="2rissssssssssstrlenfblk_ioctl(strlenlass"" i3c+csss/scsip"""ixl(=567ef="Inef="+cNote_fbl c,asksdkpege  Notepn">ofblk_ioctl(bu"clas +a="2rissssssssssbuflenfblk_ioctl(bu"oct119;        s9=568ef="Inef="+cNote_fbl c,ask      9;hdr *9   "5/a>>=56/sd.c#L1200"29ref="2rissssssssssuni1l(11491198<9Lea=59">>=57evice" class20en_>20en" class="line59name="L10589CONFIG_9>t = <9flu0589C>=57/sd.c#L1112"2i3cap_st1_sa>  te_fblk_ioctlsdkpege  Notepneneas ="3rivers/scend="srf-a1
512.\n"134" clclass="lin=57" class="589CONFIG_9>< Leent">9pan"589C>=57 translT_UNITfbl c,askssssssssssssssssssssse#39;\0e#39;ivers/s
512.\n"134" clclass="lin=57" class="5ref"lwnes9>2
=57/sd.c#L1194"2L196put_device"uni1l(sdkpege  Notepn"asifblk_ioctl(basi="sr
512.\n"134" clclass="lin=57153">11535/a>      9>
>=57"sD_FLUSH_TIMdo93"sref">scsi_a} else lass="lin=59name="Le=5ref"lwnes9>    =57omment">/*sdkpege  Notepn"eginfblk_ioctl(begin="sr1csi/sd.c#L11*1134" class="lin=59name="L105L1189">119>     3
7a9   05L11>=57ref="Inef="+c8de=ou888v" cl868dateda-sdkpege  NotepnEINVALl(1149
>=57vers/scsi/sd203a >203*--sdkpege  Notepnte_fblk_ioctlssssssssssssssssssssse#39;ae#39;ivers/s +a"" i3c+csss/scsi9ndexl((119>        s92ri=5L11>=57f="[0]+coe=sd8v" cl86" i3c+csss/scsi9ndexl(((hdr *9en_"5cla>=57/sd.c#L1200"2} whilea"" i3c+csss/scsi9ndexl(=58evice" class20en_>20en" class="line5cname="L105class="sr9it = <9_by05cla>=58/sd.c#L1112"2i3cap_st1_sa>  memmovifblk_ioctl(memmovilass="sref">d1"sref""eginfblk_ioctl(begin="sr"">sdkpege  Notepte_fblk_ioctlsdkpege  Notepeneas ="3rivers/scend="srf-a>sdkpege  Notepte_fblk_ioctl9cod"5cla>=58 translT_UNITL196put_device"memcpyl(d1"sref"">ofblk_ioctl(bu"clas""bl c,ask((recsi_blo9=583p, 11535ref"lwnes9>
=58coode=sdp" cl8dateda0e  Nocapacity0" clascla" name==58name="Le=5L1189">119>    =58k_whe9#L1110" i3s/scsi Notla" name==5cname="L105ref"lwnes9>     3
7a9ntk05ref>=58dp=58vers/scsi/sd.9#L11999href==/sivers/scsi/sd.c#L11*1134" class="lin=5cname="Le=5class="sr9s        s9"2r=5cla>=58i/sd.c#L1189"9i2="L98ss="s="c T"rrasynchronous part ofwsref"obr="134" i3="""""""""*1134" class="lin=58" class="5class="sr9ahdr *92ri"5cla>=58/sd.cscsi/sd.9#L11999href=="*rivers/scsi/sd.c#L11*1134" class="lin=59name="Le=5class="sr9 =59a="[0aode=dev9ce6sss="s89ss="sreessf"obr_asyncl(sdkpege cata_ioctl((=59/sd.c3"sref">scsi_a} else lass="lin=59" class="5/a>      9 1198<9ruc"5/a>>=59 translT_UNIT9o,eL191ss="sref">devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(sdkpege  Notepncata_ioctl(
=59/sd.c#L1194"29o,eL191ss="sref">devef"d_blk_ioctl((11535ref"lwnes9>
=594sd.c#L1194"29o,eL191ss="sref">devegendiskf"lwnes93sdkpege geas ="3rivers/scgd=595="[0]+coe=sdscsi2="L_NOTIC2uref"lwnes93rmax_cu/ trans" i3c+csss/scsi9ndexl(=59ref="Inef="+c9o,eL191ss="sref">devec/iblk_ioctl(sdkpege cevl(=59vers/  Nocapacity0" clascla" name==59name="Le=5class="sr9         s9"2r=5cla>=59f="[0]+coe=sd" i3c+csss/scsi Note_fblk_ioctl(sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(>=599="[0]+coe=sd" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Notepn_psdkpege  Note_fbl ck_ioctl(1149<203
(sdkpege  Note_fbl 9ndexl(  cevl(sdkpege  Notepn_pssev_genkevl(
sdkpege  Note_fbl majo_fblk_ioctl(majo_clas /asdkpege  Notepn_p_majo_fblk_ioctl(_p_majo_lass""" i3c+csss/scsi9ndexl(
sdkpege  Note_fbl first_mino_fblk_ioctl(first_mino_clas /a""" i3c+csss/scsi9ndexl((12035sdkpege  Note_fbl mino_sas ="3rivers/scmino_sclas /asdkpege  NotepnSD_MINORSas ="3rivers/scSD_MINORSclase  Nocapacity0" clascla" name==6 6ame="Le=6Lef"lwnes9      3
7a9p  06     60dpsdkpege  Note_fbl fopsas ="3rivers/scfops="sr /ator_sscsi2="L_NOTIC2f1_fopsas ="3rivers/scf1_fopsclase  Nocapacity0" clascla" name==6 8ame="Le=6Llass="sr9         s9"2r=6ers/s60f="[0]+coe=sd" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Note_fbl py0"atedkata_ioctl(sdkpege  Note_fbl cy0" cl(sdkpege  Note_fbl queueoctl(sdkpege  Notepn_psdkpege  Note_fbl c/iblk_ioctl(sdkpege  Note_fbl  cquest_queueoctl(1201
20en" class="line6 name="L1066">1066<2011sdkpege  Notepn_psector_sizctl(512e  Nocapacity0" clascla" name==6 3ame="L116ref"lwne20e3(sdkpege  Note_fbl capacityas ="3rivers/sccapacityclasf">0e  Nocapacity0" clascla" name==6c153">11536class="sr9snthengniz9si_36claap61coode=sdp" clscsi2="L_NOTIC2scote_fblk_ioctl(sdkpege  Note_fbl mediaef"esan2
a href="2rivermediaef"esan2="srd/a1
512.\n"134" clclass="lin=6Oname="Le=6class="sr9s5ss="comm93ri=6claap615="[0]+coe=sdscsi2="L_NOTIC2scote_fblk_ioctl(sdkpege  Note_fbl writedprote_fblk_ioctl0e  Nocapacity0" clascla" name==6c6ame="Le=6ref"lwnes936thengniz9="c06refap61ref="Inef="+cscsi2="L_NOTIC2f1ote_fblk_ioctl(sdkpege  Note_fbl WCE189">1201 rfirsWCE="srf">0e  Nocapacity0" clascla" name==6c7ame="Le=6ref"lwnes9s7paterror9wou"6refap61vers/scsi/sd2scsi2="L_NOTIC2f1ote_fblk_ioctl(sdkpege  Note_fbl RCDe_fblk_ioctl0e  Nocapacity0" clascla" name==6c8ame="Le=6/a>      938paterror9   =6/a>ap61f="[0]+coe=sd" i3c+csss/scsi Note_fblk_ioctl(sdkpege  Note_fbl ATOf"="+code=scsi_ATO="srf">0e  Nocapacity0" clascla" name==6c9ame="Le=6/a>      939thengniz9   "6/a>ap619="[0]+coe=sd" i3c+csss/scsif1ote_fblk_ioctl(sdkpege  Note_fbl first_scatl(1
512.\n"134" clclass="lin=62name="Le=6/a>      9>(sdkpege  Note_fbl max_medium_access_timeoutstl(        i9 (!"6ref>=62 translT_UNITL196put_device"f1_ cvalieatedkp" as ="3rivers/scs1_ cvalieatedkp" lass=" i3c+csss/scsigeas ="3rivers/scgd>=623p, 11536ref"lwnes9>nthengniz9=62coode=sdp" clscsi2="L_NOTIC2blk_queue_f"ep_rqfblk_ioctl(blk_queue_f"ep_rqlass=" i3c+csss/scsif1eef"="+code=scsi_deearef">sdkpege  Notepn_p cquest_queueoctl(sdkpege  Notepi1sssep_ftl(      9>5ss="comm9>(<=6/a>>=625="[0]+coe=sdscsi2="L_NOTIC2blk_queue_unf"ep_rqfblk_ioctl(blk_queue_unf"ep_rqlass=" i3c+csss/scsif1eef"="+code=scsi_deearef">sdkpege  Notepn_p cquest_queueoctl(sdkpege  Notepi1sunf"ep_ftl(6thengniz9k_w06ref>=62dp      9>7paterror93ri"6/a>>=62vers/scsi/sd2scsi2="L_NOTIC2geas ="3rivers/scgdsdkpege  Note_fbl r_sizifs_cevl(sdkpege  Notepn_pssev_genkevl(      9>< elsentr9si_=6/a>>=62f="[0]+coe=sd" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Note_fbl flagsas ="3rivers/scflagsclas /asdkpege  NotepnGENHD_FL_EXT_DEVTas ="3rivers/scGENHD_FL_EXT_DEVTclase  Nocapacity0" clascla" name==6/9ame="Le=6/a>      9>9thengniz9>=62/sd.c#L1200"29="L*/97e=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_premovableoctl(scsi_a} else lass="lin=63name="Le=6/a>      93
>=63a="[0]+coe=sd8v" cl86" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Note_fbl flagsas ="3rivers/scflagsclas |">sdkpege  NotepnGENHD_FL_REMOVABLE189">1201 rfirsGENHD_FL_REMOVABLEclase  Nocapacity0" clascla" name==63name="L106/a>      9320e" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Note_fbl evrefsas ="3rivers/scevrefsclas |">sdkpege  NotepnDISK_EVENT_MEDIA_CHANGE189">1201 rfirsDISK_EVENT_MEDIA_CHANGEclase  Nocapacity0" clascla" name==63" class="6ref"lwnes93        i9ss="6ref>=63 translT_UNIT9#L1110" i3s/scsi Notla" name==63" class="6/a>      93i_block_w9s=""6/a>>=633p, 11536ref"lwnes93nthengniz9D  36ref>=63coode=sdp" clscsi2="L_NOTIC2adddkp" as ="3rivers/scadddkp" lass=" i3c+csss/scsigeas ="3rivers/scgd      9f
>=635="[0]+coe=sdscsi2="L_NOTIC2scdkpf_config_hos1l(      936thengniz9hre06/a>>=63dp>=63vers/scsi/sd2scsi2="L_NOTIC2f1_ cvalieatedkp" as ="3rivers/scs1_ cvalieatedkp" lass=" i3c+csss/scsigeas ="3rivers/scgd1142=6cla>=63f="[0512.\n"134" clclass="lin=639ame="Le=6ref"lwnes9>        s9a h"6ref>=639="[0]+coe=sd" i3c+csss/scsif1ssss_ioctl(d1"sref"k/a>)NOTICE189">1201 rfirsk/a>)NOTICEclas"">sdkpege  Notepi1en>, "assumc#""sref">scsi_a} else lass="lin=64name="Le=6/a>      9i_ef">host9/a>=6/a>>=64a="[0]+coe=sd8v" cl8603*/97e=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_premovableoctl(=64/sd.c#L1112"2i3cap_st1_sa>  s/scsautopm_putblk_ioctl(119i        i9DY""6L11>=64 translT_UNITL196put_device"putblk_ioctl(sdkpege  Note_fbl cevl(119ii_block_w9pan"6L11>=64/sd.c9#L1110" i3s/scsi Notla" name==64153">11536ref"lwnes9inthengniz9f="36ref>=644p, =64ommen=scsi_de9ice_o96"sref /ssL1134" i3="""""""""*1134" class="lin=64name="L106L1189">119i6thengniz9   06L11>=64  bre"css="li9e" na91 href="3      essf"obr - cilled dussss ""*113 initialization andwwhene113 aL1134" i3="""""""""*1134" class="lin=64" class="6L1189">119i
=64vers/scsi/sd.9#L11999href=="3      new  cla s/scsi is attached to t"rrsystem. It is oilled oncr="134" i3="""""""""*1134" class="lin=64name="Le=6L1189">119i1142      9ihdr *9_ak"6/a>>=64/sd.cscsi/sd.9#L11999href=="*      @s/s: pok" 13 to s/scsi objec1#Lthc#L
i" pan3table.134" class="lin=65name="Le=69">1149>=65lsD_F=sdp" cl9ss="s99ss="s="c#Lthc#L
i" pan3table.134" class="lin=65name="L1069">1149>=65/sd.c=scsi_de9ice_o96"sref "3      Rdateds 029="successful (t wnot k" 13este  9r this  cla s/scsi #Lthc#L
i" pan3table.134" class="lin=65" class="69">11499 in"69">>=65dkp" scsi/sd.9#L11999href=="*      (e.g. scatner)); 1wwhenw="rri is i/serror.n3thc#L
i" pan3table.134" class="lin=65" class="6L1189">119>2
=65/sd.cscsi/sd.9#L11999href=="*n3thc#L
i" pan3table.134" class="lin=65153">11536class="sr9>">eIOCTLC92ri36cla>=65coode=sdp" cl9ss="s99ss="s="c      Note: this function 8s 9rvokedwfrom t"rrscla mid-le11l.n3thc#L
i" pan3table.134" class="lin=65name="Le=6class="sr9>
=65ommen=scsi_de9ice_o96"sref "*si/sd2This function sets up t"rrmappsss betweenwa g*11n #Lthc#L
i" pan3table.134" class="lin=65name="L106class="sr9>6thengniz9"2r06cla>=65  bre"css="li9e" na91 href="3si/sd2pldkhos1,Notnnel,id,lunpsdk (foun  9r _de) andwnew s/scsi k_w9 #Lthc#L
i" pan3table.134" class="lin=65" class="6class="sr9>
=65vers/scsi/sd.9#L11999href=="3      (e.g. /s/sss=a). Mor9 p""ciselyM9t is t"rrbc#L1 s/scsi majo_ #Lthc#L
i" pan3table.134" class="lin=65name="Le=6class="sr9>1142=65i/sd.c#L1189"9i2="L98ss="s="c      andwmino_ numb13 that is ohos1n "rri.n3thc#L
i" pan3table.134" class="lin=659ame="Le=6class="sr9rhdr *9ruc"6cla>=65/sd.cscsi/sd.9#L11999href=="*n3thc#L
i" pan3table.134" class="lin=66name="Le=6class="sr92
=66lsD_F=sdp" cl9ss="s99ss="s="c      Assuw9 essf"obr is not re-refrant (fo3 timrrbesss)n3thc#L
i" pan3table.134" class="lin=66name="L106class="sr92  pan cla9 (!06cla>=66/sd.c=scsi_de9ice_o96"sref "c      Also t"ink about essf"obr() andws1_ cmovi() runnsst cok"cidsreilly.n3thc#L
i" pan3table.134" class="lin=66" class="6class="sr92< Leent">9eDE"6cla>=66dkp" scsi/sd.9#L11999href=="**rivers/scsi/sd.c#L11*1134" class="lin=66" class="6class="sr922
=66/sd.caode=de9ref="2risssssssssssd_f"obrctl(devec/iblk_ioctl(sdkpege cevl(11536class="sr92">eIOCTLC92ri36cla>=664pscsi_a} else lass="lin=66name="Le=6ref"lwnes92<       <9ck_=6ref>=66omment">/*devef"d_blk_ioctl(((=66ref="Inef="+c9o,eL191ss="sref">devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(=667ef="Inef="+c9o,eL191ss="sref">devegendiskf"lwnes93sdkpege geas ="3rivers/scgd119;        s9=668ef="Inef="+c9ref="2rissssssssss9ndexl(      9;hdr *9   "6/a>>=66/sd.c#L1200"29ref="2risssssssssserroras ="3rivers/scerrorclase  Nocapacity0" clascla" name==67name="Le=69">11491198<9Lea=69">>=67evice" class20en_>20en" class="line69name="L10689CONFIG_9>t = <9flu0689C>=67/sd.c#L1112"2i3cap_st1_sa>  erroras ="3rivers/scerrorclas /a-sdkpege  NotepnENODEVas ="3rivers/scENODEVclase  Nocapacity0" clascla" name==67" class="689CONFIG_9>< Leent">9pan"689C>=67 translT_UNIT9="L*/97e=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_ptypeas ="3rivers/sctypelass !/asdkpege  NotepnTYPE_DISKas ="3rivers/scTYPE_DISKlass tor_s&ege  */97e=out" classceef"="+code=scsi_deearef">sdkpege  Notepn_ptypeas ="3rivers/sctypelass !/asdkpege  NotepnTYPE_MODe_fblk_ioctlsdkpege  Notepn_ptypeas ="3rivers/sctypelass !/asdkpege  NotepnTYPE_RBCe_fblk_ioctl2
=67/sd.c#L1194"203ri>203goto#scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==67153">11536/a>      9>
>=674p,     =675="[0]+coe=sdscsi2="L_NOTIC2SCSI_LOG_HLQUEUE189">1201 rfirsSCSI_LOG_HLQUEUElass=3"">sdkpege  Notepi1evssss_ioctl(d1"sref"k/a>)INFOf"="+code=scsi_k/a>)INFOclas"">sdkpege  Notepi1eef"="+code=scsi_deeare""sref">scsi_a} else lass="lin=69name="L106L1189">119>     3
7a9   06L11>=67ref="Inef="+c8de=ou888v" cl866666666666666666nsssssssssssssssssssse namdsref"obr">"assumc#ee
512.\n"134" clclass="lin=67" class="69">1149
>=67vers/  Nocapacity0" clascla" name==67name="Le=6L1189">119>        s92ri=6L11>=67f="[0]+coe=sd" i3c+csss/scsierroras ="3rivers/scerrorclas /a-sdkpege  NotepnENOMEMas ="3rivers/scENOMEM#L11e  Nocapacity0" clascla" name==679ame="Le=6class="sr9>hdr *9en_"6cla>=679="[0]+coe=sd" i3c+csss/scsif1ote_fblk_ioctl((sdkpege  Note_fblk_ioctl(sdkpege  NotepGFP_k/a>ELl(EL="srL
512.\n"134" clclass="lin=68name="Le=6class="sr9i_ecode=s_9esu=6cla>=680translT_UNIT9="L!"sref">sdkpege  Note_fblk_ioctl(20egoto#scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11e  Nocapacity0" clascla" name==68" class="6class="sr9i< Leent">9cod"6cla>=68dkp" ef="297+co{ 0 }+codelass="lin=68" class="6ref"lwnes9>recsi_blo9=68/sd.c#L1194"2L196put_device"geas ="3rivers/scgdd1"sref"SD_MINORSas ="3rivers/scSD_MINORSclasL
512.\n"134" clclass="lin=68153">11536ref"lwnes9>
=68coode=sdp" cl9="L!"sref">sdkpege geas ="3rivers/scgd119>    =68omment">/*     3
7a9ntk06ref>=68dp=687ef="Inef="+cdo93"sref">scsi_a} else lass="lin=6cname="Le=6class="sr9s        s9"2r=6cla>=68="+code=scsi_8evice858="L!"sref">sdkpege idaef"e_ge1as ="3rivers/scidaef"e_ge1lass=tor_sscsi2="L_NOTIC2f1_9ndex_idactl(sdkpege  NotepGFP_k/a>ELl(EL="srLe512.\n"134" clclass="lin=689ame="Le=6class="sr9ahdr *92ri"6cla>=68/sd.c#L1200"203ri>20333333333goto#scsi2="L_NOTIC2ou1_pu1as ="3rivers/scpu1_pu1#L11e  Nocapacity0" clascla" name==69name="Le=6class="sr9 =69evice" class20en_>20en" class="line69name="L106class="sr9          9"2r06cla>=69/sd.c#L1112"203ri>20e" i3c+csss/scsispin_c#L1ctl((>=69 translT_UNIT]+coe=sd" i3c+csss/scsierroras ="3rivers/scerrorclas /a"sref">sdkpege idaege1_newas ="3rivers/scidaege1_newlass=tor_sscsi2="L_NOTIC2f1_9ndex_idactl(
=69/sd.c#L1194"203ri>203" i3c+csss/scsispin_unc#L1ctl((11536ref"lwnes9>
=694sd.c#L1194"2} whilea"" i3c+csss/scsierroras ="3rivers/scerrorclas //a-sdkpege  NotepnEAGAINas ="3rivers/scEAGAINclasL
512.\n"134" clclass="lin=69name="Le=6ref"lwnes9     =695="[0512.\n"134" clclass="lin=69name="L106ref"lwnes9      3
7a9p  06ref>=69ref="Inef="+c9="L*/97e=out" claserroras ="3rivers/scerrorclase93"sref">scsi_a} else lass="lin=69" class="6class="sr9 iecsi_blo9=69vers/scsi/sd203a >203>sdkpege  Notepi1evssss_ioctl(d1"sref"k/a>)WARNINGf"="+code=scsi_k/a>)WARNINGclas"">sdkpege  Notepi1eef"="+code=scsi_deeare"6nsssssssssssssssssssse namdsref"obr: memory exhauste .">"assumc#e
512.\n"134" clclass="lin=69name="Le=6class="sr9         s9"2r=6cla>=69="+code=scsi_8evice85goto#scsi2="L_NOTIC2ou1_pu1as ="3rivers/scpu1_pu1#L11e  Nocapacity0" clascla" name==699ame="Le=6/a>      9 hdr *93ri"6/a>>=699="[0]+coe=sd9#L1110" i3s/scsi Notla" name==7 name="L1179">1149<203
20en" class="line7 1ame="L1179lass="sr9          9"2r07ers/s70/sd.c#L1112"2i3cap_st1_sa>  erroras ="3rivers/scerrorclas /a"sref">sdkpege sd_ut matdkp" _  i9l(sdkpege geas ="3rivers/scgdsdkpege  Note_fbl ck_i_  i9l(sdkpege DISK_NAME_LENas ="3rivers/scDISK_NAME_LENclasL
512.\n"134" clclass="lin=7 2ame="L1179a>      9 1198<9ruc"7scsi_a} else lass="lin=7 3ame="L1179ef"lwnes9>
203" i3c+csss/scsis1evssss_ioctl(d1"sref"k/a>)WARNINGf"="+code=scsi_k/a>)WARNINGclas"">sdkpege  Notepi1eef"="+code=scsi_deeare"6nsssssssssssssssssssse namdSCSI disk/(sd) k_w9 length exceede .">"assumc#e
512.\n"134" clclass="lin=7 4ame="L1179ef"lwnes9>
12035sdkpege  Note_fbl c/iblk_ioctl(sdkpege sdote_fblk_ioctl(sdkpege  Note_fbl cy0" cl(sdkpege  Note_fbl ck_ioctl(sdkpege geas ="3rivers/scgd1201
(sdkpege  Note_fbl 9ndexl((1066<2011  atomic_se1as ="3rivers/scatomic_se1lass=tor_sscsi2="L_NOTIC2f1ote_fblk_ioctl(sdkpege  Note_fbl opene_sas ="3rivers/scopene_seare"6ge
512.\n"134" clclass="lin=7O" class="7ref"lwne20e2(sdkpege  Note_fbl c/iblk_ioctl(sdkpege  Note_fbl ioerr_cn2
a href="2riverioerr_cn2eare"6ge
512.\n"134" clclass="lin=7O3ame="L117ref"lwne20e3, 11537class="sr9snthengniz9si_37claap71coode=sdp" cl9="L!"sref">sdkpege f1eef"="+code=scsi_deearef">sdkpege  Notepn_p cquest_queueoctl(sdkpege  Notepn_p q_timeoutoctl(scsi_a} else lass="lin=7Oname="Le=7class="sr9s5ss="comm93ri=7claap71omment">/*sdkpege  Notepn_ptypeas ="3rivers/sctypelass !/asdkpege  NotepnTYPE_MODe_fblk_ioctl(d1"sref"f1eef"="+code=scsi_deearef">sdkpege  Notepn_p cquest_queueoctl(sdkpege  NotepSD_TIMEOUTas ="3rivers/scSD_TIMEOUTclasL
512.\n"134" clclass="lin=7c7ame="Le=7ref"lwnes9s7paterror9wou"7refap71vers/scsi/sd203a >203else512.\n"134" clclass="lin=7c8ame="Le=7/a>      938paterror9   =7/a>ap71="+code=scsi_8evice858v" cl86sdkpege  Notepnblk_queue_ q_timeoutoctl(d1"sref"f1eef"="+code=scsi_deearef">sdkpege  Notepn_p cquest_queueoctl(      939thengniz9   "7/a>ap71/sd.c#L1200"203ri>20333333333scsi_8evice858v" cl86sdkpege  NotepnSD_MOD_TIMEOUTas ="3rivers/scSD_MOD_TIMEOUTclasL
512.\n"134" clclass="lin=72name="Le=7/a>      9>        i9 (!"7ref>=72 translT_UNITL196put_device"s/scsi_initializk_ioctl((sdkpege  Note_fbl c/i_ioctl(      9>3ss="comm9eDE"7/a>>=72/sd.c#L1194"2L196put_device"i1ote_fblk_ioctl(sdkpege  Note_fbl c/i_ioctl(11537ref"lwnes9>nthengniz9=72coode=sdp" clscsi2="L_NOTIC2i1ote_fblk_ioctl(sdkpege  Note_fbl c/i_ioctl(((      9>5ss="comm9>(<=7/a>>=725="[0]+coe=sdscsi2="L_NOTIC2revsse1_n i9l((sdkpege  Note_fbl c/i_ioctl(sdkpege  Notepkevsn i9l((6thengniz9k_w07ref>=72dp      9>7paterror93ri"7/a>>=72vers/scsi/sd29="L*/97e=out" class/scsi_adeas ="3rivers/scs/scsi_adelass=tor_sscsi2="L_NOTIC2f1ote_fblk_ioctl(sdkpege  Note_fbl c/i_ioctl(      9>< elsentr9si_=7/a>>=72="+code=scsi_8evice85goto#scsi2="L_NOTIC2ou1_free_9ndexl(      9>9thengniz9>=72/sd.c  Nocapacity0" clascla" name==73name="Le=7/a>      93
>=73a="[0]+coe=sdscsi2="L_NOTIC2ge1_c/iblk_ioctl((      93  cevsse1_drvcata_ioctl((sdkpege  Notepi1en>, >=73/sd.c#L1194"2L196put_device"ge1_c/iblk_ioctl(sdkpege  Note_fbl c/i_ioctl(11537ref"lwnes93nthengniz9D  37ref>=73coode=sdp" clscsi2="L_NOTIC2async_schedule_domainfblk_ioctl(async_schedule_domainlass="sref">d1"sref"f1sf"obr_asyncl(sdkpege  Notepi1en>, (fsssdessf"obr_domain refLe  Nocapacity0" clascla" name==73name="Le=7/a>      9f
>=735="[0512.\n"134" clclass="lin=7/name="L107/a>      936thengniz9hre07/a>>=73ref="Inef="+c8dateda0e  Nocapacity0" clascla" name==73" class="7/a>      93
>=73vers/  Nocapacity0" clascla" name==73name="Le=7class="sr9>1142=7cla>=73f="[0#scsi2="L_NOTIC2ou1_free_9ndexl(        s9a h"7ref>=739="[0]+coe=sd" i3c+csss/scsifpin_c#L1ctl((      9i_ef">host9/a>=7/a>>=74a="[0]+coe=sdscsi2="L_NOTIC2idae cmovi
a href="2riveridae cmovilass=tor_sscsi2="L_NOTIC2f1_9ndex_idactl(sdkpege  Notep9ndexl(=74/sd.c#L1112"2i3cap_st1_sa>  spin_unc#L1ctl((119i        i9DY""7L11>=74 trans" i3c+csss/scsiou1_pu1as ="3rivers/scpu1_pu1#L11:  Nocapacity0" clascla" name==74" class="7L1189">119ii_block_w9pan"7L11>=74/sd.c#L1194"2L196put_device"putblk_ioctl(d1"sref"geas ="3rivers/scgd11537ref"lwnes9inthengniz9f="37ref>=744p(=745="[0]+coe=sdscsi2="L_NOTIC2kfreeoctl(119i6thengniz9   07L11>=74  bre#scsi2="L_NOTIC2ou1as ="3rivers/scpu1#L11:  Nocapacity0" clascla" name==74" class="7L1189">119i
=747ef="Inef="+c8datedascsi2="L_NOTIC2erroras ="3rivers/scerrorclase  Nocapacity0" clascla" name==74name="Le=7L1189">119i1142      9ihdr *9_ak"7/a>>=74/sd.c  Nocapacity0" clascla" name==75name="Le=79">1149>=75lsD_F=sdp" cl9ss="s99ss="s=/ssL1134" i3="""""""""*1134" class="lin=75name="L1079">1149>=75/sd.c=scsi_de9ice_o96"sref "3      s1_ cmovi - cilled whene113 a  cla sisk/(previouslyc8dcognized byL1134" i3="""""""""*1134" class="lin=75" class="79">11499 in"79">>=75dkp" scsi/sd.9#L11999href=="*      essf"obr) is detached from t"rrsystem. It is oilled (potrefiillyL1134" i3="""""""""*1134" class="lin=75" class="7L1189">119>2
=75/sd.cscsi/sd.9#L11999href=="*      multiple"times) dussss sd module"unc#ad.n3thc#L
i" pan3table.134" class="lin=75153">11537class="sr9>">eIOCTLC92ri37cla>=75coode=sdp" cl9ss="s99ss="s="c      @sdp: pok" 13 to mid le11l  cla s/scsi objec1#Lthc#L
i" pan3table.134" class="lin=75name="Le=7class="sr9>
=75ommen=scsi_de9ice_o96"sref "*#Lthc#L
i" pan3table.134" class="lin=75name="L107class="sr9>6thengniz9"2r07cla>=75  bre"css="li9e" na91 href="3si/sd2Note: this function 8s 9rvokedwfrom t"rrscla mid-le11l.n3thc#L
i" pan3table.134" class="lin=75" class="7class="sr9>
=75vers/scsi/sd.9#L11999href=="3      This function potrefiilly frees up a s/scsi k_w9 (e.g. /s/sss=c)n3thc#L
i" pan3table.134" class="lin=75name="Le=7class="sr9>1142=75i/sd.c#L1189"9i2="L98ss="s="c      that could be re-used by a  ubscquent essf"obr().n3thc#L
i" pan3table.134" class="lin=759ame="Le=7class="sr9rhdr *9ruc"7cla>=75/sd.cscsi/sd.9#L11999href=="*      This function is not cilled when t"rrbuilt-9r _d ""*113 is "exit-er".n3thc#L
i" pan3table.134" class="lin=76name="Le=7class="sr92
=76lsD_F=sdp" cl9ss="s99ss="s="c*rivers/scsi/sd.c#L11*1134" class="lin=76name="L107class="sr92  pan cla9 (!07cla>=76/sd.caode=de9ref="2risssssssssssd_ cmovi
a href="2riversd_ cmovi#L11=9o,eL191ss="sref">devec/iblk_ioctl(sdkpege cevl(9eDE"7cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
=76/sd.c#L1194"29o,eL191ss="sref">devef"d_blk_ioctl(sdkpege  Note_fblk_ioctl(11537class="sr92">eIOCTLC92ri37cla>=764p, =765="[0]+coe=sdscsi2="L_NOTIC2 Note_fblk_ioctl(sdkpege  Notepncev_ge1_drvcata_ioctl((=76ref="Inef="+c1ss="sref">devef"d_bautopm_ts, un1sl t"rrs/scsi telll(blk_queue_f"ep_rqlass=" i3c+csss/scsiy >sdkpege  bout e_F=sda3196put_device"putblk1/a ref"c 4nr _d 3table.134" class="lin=66name="Le=6cl67sdkpege sdo1134" c34"hro79">_full*rivers/scsi/sd.c#L11*1134" c34"hro79">_full*rivers4" clclass="lin=74name="L1ef">d1"sref"f1sf"obr_asyncl(sdkpege  Notepi1en>, 1197        s9=668ef7"Inef76IC2ou1_free_9ndexl(>=623p, 11536ref"lws/sc609="[0]+coe=sd" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Note_fbl queueoctl(sdkpege  Notepn_psdkpege  Notepi1en>,       97hdr *9   "6/a>>=66/sd7c#L1277TIC2f1_9ndex_c#L1ctl(      9s/sc609="[0]+coe=sd" i3c+csss/scsigeas ="3rivers/scgdsdkpege  Note_fbl queueoctl(sdkpege  Notepn_psdkpege  Notepi1en>, 11491198 ctor_sdel>=72dp        i9 (!"7ref>=72 translT_UNITL196put_device"s/scsi_initializk_ioctl(  erroras ="3rivers/sce7rorcl77=72name="L10789CONFIG_9>(      ctl(sdkpege  Note_fbl c/i_io_shutdowsss/scsif1eef"="+coshutdows7ref>=765="[0]+coe=sdscsi2="L_NOTIC2 Note_fblk_ioctl(sdkpege  Notwnes9>2
=67/sd.c#L1794"207ri>203goto#scsi2="L_NOTIC2ou1as ="3r7vers/scpu17L11e  Nocapacity0" clascl7" nam7==67153">11536/a>      9>
(sdkpege  Notwpncev_ge1_ref"k/a>)INFOf"="+code=sc7i_k/a77catalass"nege  Note_fbl c/i_ioctl(      93sdkpege  Notepi1en>, 119i        i9DY""6L11>=64 translT_UNITL196put_device"putblk_ioctl(1149
(sdkpege  Notw1189">1197scsierroras ="3rivers/sce7rorcl7774name="Le=7L1189">119i1142sd7pege  NotepGFP/a>      9f
>=735="[0516class="sr7i_ecode=s_9esu=6cla>=680t7anslT7UNIT9=ascsi2="L_NOTIC2erroras ="3river="sr9it=68/sd.c#L1712"207ri>20egoto#scsi2="L_NOTIC2ou1as ="3r7vers/scpu17L11e  Nocapacity0" clascl7" nam78d from t"rrsystem. It is oi *9_ak"7/a>>=74/sd.c  Nocapacity0" clnillocdkp"7as ="3rivers/scallocdkp" 7ass="78    multiple"times) dussss sd modulcsi_a} el_r_sscsi2- Cn3tabltoable.class="lia} elclass="ur1189">119i
=64vers/s711536ref"l7nes9>
=78cood78function 8s 9rvokedwfrom t"rrscla m f"esan2.n3thc#L
embeddabl 9rvo "139">119i
=64vers/s71pncev_ge1_L11>=68omment">/*=75ommen=scsi_de9139">119i
=64vers/s71" i3c+csssL11e  Nocapacity0" clascl7" nam78function 8s 9rvokedwfrom t"rrscla msd.c#7_mut"l m"*11be held en3th"""" "*#Lroutcit.  Becausi24" cl139">119i
=64vers/s71uot;assum7tor_siziref=la" name==68"7class78iilly frees up a s/scsi k_w9 (e.g.  class="6 up t 2.\, you sh=c)n3alway cla.class="lia} el"lin(="sr9>
=75vers/scsi/sex_idactl<7a>(sd78could be re-used by a  ubscquent es="lia} el"2.\() helpla>#L1cch manipu"3riclass=emaph_NOTdirect1499 in"79">>=75dkp" scsi/s2ri"6cla>=78/sd.c#L1200"203ri>20333373333g79 *9ruc"6cla>=65/sd.cscsi/sd.9#L1199in=65n="Ledo clairect 2.\n"9ruc"7cla>=75/sd.cscsi/sd.9#L11999href=/scpu1_pu17L11e  Nocapacity0" clascl7" nam79<9 hr=79">>=75lsD_F=sdp" cl9s;exit-er".n3thc#L
i" pan3table.134"tl(=7voidsr92< Leent">9eDE"7cla>=7_r_sscsi6dkp" 3"sref">scsi_a} el_r_sscsi1134" class="lin=76name="L107class="sr92  pan cla9 (!07cla>=76/sd.caode=de9ref="2risssssssssssd_ cmovi
a href="2riversd_ cmovi#L11=91_9ndex_id7ctl(sdkpege cevl((9eDE"7cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
=66omment">/*=76dkp" 3"sref">s=77ref>=765="[0]+coe=sdscsi2="L_NOTIC2 Note_fblk_ioctl(sdkpege  Noti3c+csss/s7sierroras ="3rivers/scerr7rclas7966153">11536class="sr92">eIOCTLC92roctl(      _ioctl(sdkpege  Notipncev_ge1_asL
512.\n"134" clcl7ss="l7n=69name="Le=6ioctl(sdkpege  Noti" i3c+csss   3
7a9p  06ref>=69ref="7nef="79=7 6ame="Le=7Lef"lwnes9      x_cou1_free_9ndex#L11:  Nocapacity0" clascla" name==739ame="Le=7ref"lwnes9>        s9a h"7ref>=739="[0]+coe=sd" i3c+csss/scsifpin_c#L1cef"="+code7scsi_deeare"6nsssssssssss7sssss79=67" class="69">1149
      9i_ef">host9/a>=7/a>>=74a="[0]+coe=sdscsi2="L_eas ="3rivers/scgd1201]+coe=sd" i3c+csss/scsifpin_c#L1cex_idactl<7=6cla>=69="+code=scsi_8ev7ce85g79IC2ou1_free_9ndexl(=74/sd.c#L1112"2i3cap_st1_sa>  spin_unc#L1ct81#L11e  No8apacity0" clascla" name==899ame8"Le=6/a>      9 hdr *93ri"6/a>>=899="[0]+co8=sd9#L1110" i3s/scsi Notl8" nam8==7 name="L1179">1149<203
 *93ri"7rNUL"e_ge1as ="3riveNUL"clas2"2i3cap_st1_sa>  spin_unc#L1ct812="[0]+co8=a_spin_c#L1lass=tor_sscs8f">sd80_ioclass=" i3c+csss/scsif1eef"="+ers/scpu1_pu1#L11:  Nocapacity0" clascla" nameeame==7 9ame="Le=7La>      ctl(      9 1898<9ruc"7119i        i9DY""6L11>=64 translT_UNI/scgdsdkpege  Note_fbl queueoctl(((4     9 189spin_unc#L1lass=tor_sscs8 namd80i>203goto#scsi2="L_NOTIC2ou1as ="3r8ref=70cood8=sdp" cl8evice85goto#scsi8="L_N80scsi2="L_NOTIC2ou1_freeoctl(=745="[0]8x#L11e  No8apacity0" clascla" name==8 name8"Le=7Lascsi2="L_NOTIC2erroras ="3rive805="[0]+co8=sd9#L1110" i3s/scsi Notl8" nam80put_device"putblk1/a ref"c 4nr _d 38">sdkpege 8Note_fbl c/iblk_ioctl8=76lsD_F=sdp" cl9ss="s997clrt97cop/sclasL
512.\n"134997clrt97cop/sclasL1134" class="lin=76name="L1E"7cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
8sdkpege cevl(sd8pege  Note_fbl ck_ioctl(((sdkpege  Note_fbl c/i_8sdkpege  N8te_fbl 9ndexl(=745="[0]8="L_NOTIC281ote_fblk_ioctl(sdk8ege  Note_fbl lass="sr92">eIOCTLC92ri36cla>=664pscsi_a} else lass="lin=66name="Le=6ref"lwnes92<       <9ck_=6ref>=66omment">/*ss="6L1189">119i        i9DY""6L11>=64 translT_UNI/scgdsdkpege  Note_fbls9i
=745="[0]8=      9 18ctl(s8kpege81ns" i3c+csss/6lsD_F=sdp" cl9ss="ref">sdkpege  Noteref_fbls9i
=745="[0]8=4     9 186ge
512.\n"134" clcl8ss="l81i>203goto#scsi2="L_NOTIC2ou1as ="3r8eoctl(8a c+c cquest_queueclasf">8dkpeg8  Notepn_p q_ttl(((sdkpege  Note_fbl c/i_8s5="[0]+co8a>(sd81put_device"putblk1/a ref"c 4nr _d 38n"1348 clclass="lin=7c7ame="Le=8ref"l8nes9s7paterrortl(scsi_a} else lass="lin=7Ona7clrt97cop/pwr_con=74" class="7L117clrt97cop/pwr_con= cmovi
a href="2riversd_ cmovi#L11=8e0" cl8"+code=scsi_deearef">sdkp8ge  N8tepn_p cquest_queueoct_F=sdp" cl9ss="cm=74" class="7L11cm=kp" [4] |= a>(sdkpege  Note_fbl c/i_803333333338csi_8evice858v" cl86sdkpe8e  No82Le=6/a>      9 hdr *93ri"6/a>>=8clasL
512.8n"134" clclass="lin=82name821s9s7paterrortlscsi_a} else l_on clcNocapacity0" clascla"  cla9 hr06ref>=64/sd.c#Lvi
a href="2riversd_ cmovi#L11=82a="[0]+co8=sd9#L1110" i3s/scsi Notl8" nam82TIC2f1_9ndex_c#L1ctl    en_>20en" class="line69name="L10689CONFIG_9>t = <9flu0689C>=67/sd.c#L1112"8=tor_sscsi8="L_NOTIC2f1ote_fblk_ioct8(82Note_fbl ioerr_cn2
a href="2riverio8clas.pege 8Note_fbl paran2
a href="28iverp8ran2clas /asdkpege  Notepncevref">sdkpege  Noteref_fbl6ref>=66omment">/*s_a} execua" rearee
512.\n"s_a} execua" reaNocapacity0" clascla"  cla9 hr06ref>=64/sd.c#]+coe=sdscsi2="L_cm=74" class="7L11cm=kp" 9ndexl(>=73/sd.c#L11NUL"e_ge1as ="3riveNUL"clas, 0schedule_domainlass="srshds/scpu1#L11:  NoEshdsas /queue_ q_timeoutlass="sref">d1"8l<_ioctl(d1"sref"f1eef"="+code=scsi_dqueue_ q_timeoutlassMAX_RETRIEL1194"2L196put_devicAX_RETRIELs="07/a>>=73/sd.c#L11NUL"e_ge1as ="3riveNUL"class"">sdkpege  Notepi1en>, sdkpege 8Notepkevsn i9l(sdkpege  Noteref_fblref">sdkpege  Notepn_p cquest_que8(scsi_aelse lass="lin=7 3ame="L1179ef"lwnes9>
203" i3c+cs"7class="sr922
sdkpege  Notepi1eef"="+co8=tor_sscsi8="L_NOTIC2f1ote_fblk_ioct8(8a ref">sdkpege  Note_froras ="3rivers/srrorcl resultclass="sr922
203" i3c+ref">sdkpege  Noteref_fblrlas"">sdkpege  Notepi1eef"="+co8=0" cl8de=scsi_8evice85goto#scsi8="L_N82epn_p cquest_queueoctref"lwnes9>6thengnize  No_byd" i3c+csss/scsifze  No_byd"Nocapacity0" clasclaref">sdkpege  Noteref_fblre="+code=scsi_deearef"DRIVER_SENSE74" class="7L11xRIVER_SENSE cmovi
a href="2riversd_ cmovi#L11=8free_9ndex8L11e  Nocapacity0" clascl8" nam8==7/9ame="Le=7>sdkpege  Note_froras ="3rivers/srrorcl sense_hds/scpu1#L11:  NoEsrrorcl sense_hdsNocapacity0" clascla" name==74name="Le=7ref"lwn4"hedule_domainlass="srshds/scpu1#L11:  NoEshdsas /rlas"">sdkpege  Notepi1eef"="+co8si2="L_NOT8C2ge1_c/iblk_ioctl(sdkpege  Notepi1en>, sdkpege  Noteref_fbls9i
=745="[0]8octl(<8 rs/sclasL
2=scsi_de9ice_896"sr8f /s pascsi2="L_NOTIC2erroras ="3rive8c<_ioctl(fsssdessf"8br_domain 8efLe  Nocapacity0" clascl8" nam83f=9"+c=7cla>=75ommen=scsi_d/9139">119i
=64vers/s82.\n"834" clclass="lin=7/name="8107/a83function 8s 9rvokedwfrom t"rrsSend a SYNCHRONIZE CACHE inlass="3thcdowsc#L
lassass="lithrough139">119i
=64vers/s82tor_sscsi8da0e  Nocapacity0" clascl8" nam83iilly frees up a s/scsi k_w9 (lassn9"2rl ef">d/scse.134ass="ur1.  Wait classass/scse.13to139">119i
=64vers/s820" cl8=7cla>=73f="[0#scsi8="L_N83could be re-used by a  ubscquey aplet;9ruc"7cla>=75/sd.cscsi/sd.9#L11999href8tl(=65/sd.cscsi/sd.9ctl(sdkpege  Note_fbl c/i_8TIC2f1_9nd8x_idactl(=7voidsr92< Leent">9eDEo_shutdowsss/scsif1eef"="+coshutdows7ref> class="lin=76name="L107class="sr92  pan cla9 (!07cla>=76/sd.caode=de9ref="2risssssssssssd_ cmovi
a href="2riversd_ cmovi#L11=8(sdkpege cevl(119i        i9DY""7L118=74 t8476" class="7class="sr92< Leent">9eDE"7cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
=66omment">/*s_a} } el"lin_34" _te_fbl r_sizifs_cev_a} } el"lin_34" _te_7ref>=765="[0]+coe=sdscsi2="L_NOTIC2 Note_fblk_ioctl(sdkpege  No894"2L196pu8_device"putblk_ioctl(8a c+c84i>203goto#scsi2="L_NOTIC2ou1as ="3r811537ref"l8nes9inthengniz9f="37ref>=844pELl(EL="srL
512.\n"134" clclass="lin=68name="Le8coe=sdscsi8="L_NOTIC2kfreeoctl(<8 c+ck84sdkpege  NotepnTYPE_Mi2="L_;e  Note_fr_ioctl((sdkpege  Note_fbl c/i_8T.\n"8L107L1189">119i6thengniz98  07L84put_device"putblk1/a ref"c 4nr _d 3889">119i
<8 href=9* t"7L11>=747ef="I8ef="+84es9s7paterrortl(8ase  Nocapacity0" clascla8 name84epn_p cquest_queueoctbl c/i_ioctl(=74i8sd.9#L1110" i3s/scsi Notl8" nam85Le=6/a>      9 hdr *93ri"6/a>>=8ascla" nam8==75name="Le=79">1149=66omment">/*ss="6L1189">119i        i9DY""6L11>=64 translT_WCE74" class="7L11WCE_fblref">sdkpege  Notepn_p cquest_que8e9ice_o96"8ref "3      s1_ cmovi - c8lled 85TIC2f1_9ndex_c#L1ctl(scsi_aelse lass="lin=7 3ame="L1179ef"lNOTICE74" class="7L119ef"lNOTICEL1194"203ri>203" i3c+cs"7class="sr922
d/i3="si_k/a>)WARNINGclas"">sdkpege  Notepi1eef"="+co8d.9#L119998ref=="*      essf"obr) is8detac859="L*/97e=out" claserroras ="3rivers/s c34"_/i3="ss/scsif1eef"="+cos34"_/i3="Nocapacity0" clascla" name==74name="Le=7ref"lwnes9i
=745="[0]89"2r"7L11>875/sd.cscsi/sd.9#L11999hr8f=="*85TIC2f1_9ndex_c9i
=745="[0]891537ref"l8de=sdp" cl9ss="s99ss="s="8     85obr_domainfblk_ioctl(fsssdessf"84" class="8in=75name="Le=7class="sr98
119i        i9DY""6L11>=64 translT_UNI/scgdsdkpege  Note_fbl queueoctl(sdkpegese.age97clrt97cop_fblref">sdkpege  Notepn_p cquest_que8e.\n"89e" na91 href="3si/sd2Not8: thi859="L*/97e=out" claserroras ="3rivers/srrorclase93"sref">scsi_aelse lass="lin=7 3ame="L1179ef"lNOTICE74" class="7L119ef"lNOTICEL1194"203ri>203" i3c+cs"7class="sr922
)WARNINGclas"">sdkpege  Notepi1eef"="+co8d9">119i
<8ref=="3      This functio8 potr85 ref">sdkpege  Note_froras ="3rivers/sr7clrt97cop/sclasL
512.\n"134997clrt97cop/sclasL1134"203ri>203" i3c+cs"7class="sr922
(sdkpege  Note_f8>=75i/sd.c8L1189"9i2="L98ss="s="c   8  tha85o#scsi2="L_NOTIC2ou1_pu1as ="3rivers/scpu1_p8="*      T8is function is not cilled8when 86Le=6/a>      9 hdr *93ri"6/a>>=8 class="li8=76name="Le=7class="sr92
8a hre8=92ri=i_ioctl(devec/iblk_ioctl=745="[0]8rmax_csev=8sr1csi/sd.c#L11*1134" cla8s="li8=76" cTIC2ou1_pu1as ="3rivers/scpu1_p8="2r"7L11>8vef"d_blk_ioctl(sdkpege  Note_fblk_i8ctl(=76/sd.caode=de9ref="2risssssssssssd_ cmo4"203ri>203" i3c+pm_message9>>=72/sd.c#L1194"m_message9>as /a"lin=76name="L1mesggdsdkpegesesgn"134" clclass="lin=68name="Le8epncev_ge18drvcata_ioctl(sdkpege  Notepn_p cquest_que8=" i3c+css8/scsiy >sdkpege  bout e_F8sda31869="L*/97e=outlass="sr92< Leent">9eDE"7cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
=66omment">/*s_a} } el"lin_34" _te_fbl r_sizifs_cev_a} } el"lin_34" _te_7ref>=765="[0]+coe=sdscsi2="L_NOTIC2 Note_fblk_ioctl(sdkpege  No8able.134" 8lass="lin=66name="Le=6cl68>=735="[058L1189">1198        s9=668ef8"Inef8674name="Le=7L1189">119i1142      98hdr *9   "6/a>>=66/sd8c#L1287TIC2f1_9ndex_tlELl(EL="srL
512.\n"134" clclass="lin=68name="Le8/class="li8lase  Nocapacity0" clascl8" nam87=69name="Le=6class="s/a>      ss=" i3c_ioctl((sdkpege  Note_fbl c/i_8i3cap_st1_8a>  erroras ="3rivers/sce8rorcl87sclas"">sdkpege  Notepi1en>, sdkpegetl=66omment">/*ss="6L1189">119i        i9DY""6L11>=64 translT_WCE74" class="7L11WCE_fblref">sdkpege  Notepn_p cquest_que8wnes9>2
=67/sd.c#L1894"2087SI disk/(sd) k_w9 lenroras ="3rivers/srrorclase93"sref">scsi_aelse lass="lin=7 3ame="L1179ef"lNOTICE74" class="7L119ef"lNOTICEL1194"203ri>203" i3c+cs"7class="sr922
d/i3="si_k/a>)WARNINGclas"">sdkpege  Notepi1eef"="+co8vers/scpu18L11e  Nocapacity0" clascl8" nam87OTIC2f1_kp" __________F=sdp" cl9ss="redkpege f1eef"="+ce6put_devroras ="3rivers/s c34"_/i3="ss/scsif1eef"="+cos34"_/i3="Nocapacity0" clascla" name==74name="Le=7ref"lwnes9i
=745="[0]8wpncev_ge18ref"k/a>)INFOf"="+code=sc8i_k/a87sdkpege  NotepnTYPE_Mref"lwnes9     (scsdolc_fbls9i
=745="[0]8quot;assum8#ee
512.\n"134" clcl8ss="l8n=67" class="6TIC2ou1_pu1as ="3rivers/scpu1_p8w1189">1198scsierroras ="3rivers/sce8rorcl8774name="Le=7L1189">119i1142sdkpege  8ote_fblk_ioctl(sd88TIC2f1_9ndex_tlsdkpegesesgn&ques9>nthengniz9119i        i9DY""6L11>=64 translT_UNI/scgdsdkpege  Note_fbl queueoctl(sdkpegese.age97clrt97cop_fblref">sdkpege  Notepn_p cquest_que86class="sr8i_ecode=s_9esu=6cla>=680t8anslT88=69name="Le=6class="sroras ="3rivers/srrorclase93"sref">scsi_aelse lass="lin=7 3ame="L1179ef"lNOTICE74" class="7L119ef"lNOTICEL1194"203ri>203" i3c+cs"7class="sr922
)WARNINGclas"">sdkpege  Notepi1eef"="+co8="sr9it=68/sd.c#L1812"2088TIC2f1_9ndex_c#L1ctl(203" i3c+cs"7class="sr922
(sdkpege  Note_f8vers/scpu18L11e  Nocapacity0" clascl8" nam88367" class="6TIC2ou1_pu1as ="3rivers/scpu1_p8nillocdkp"8as ="3rivers/scallocdkp" 8ass="88" class="sref">sdkpege  Note_fblk_i811536ref"l8nes9>
=88cood88functi_ioctl(scsdolc_fblrefL
512.\n"134" clclass="81pncev_ge18L11>=68omment">/*=745="[0]81" i3c+css8L11e  Nocapacity0" clascl8" nam88>=74  bre#scsi2="L_NOTIC2ou1as ="3rredkpege f1eef"="+ce6put_s9i
=745="[0]81uot;assum8tor_siziref=la" name==68"8class88datedascsi2="L_NOTIC2erroras ="3rive8ex_idactl<8a>(sd8874name="Le=7L1189">119i1142=88/sd.c#L1200"203ri>20333383333g89 *9ru7cla>=76lsD_F=sdp" cl9ss="s99sssu1_n i9lass=tor_sss99sssu1_7ref> class="lin=76name="L107class="sr92  pan cla9 (!07cla>=76/sd.caode=de9ref="2risssssssssssd_ cmovi
a href="2riversd_ cmovi#L11=8/scpu1_pu18L11e  Nocapacity0" clascl8" nam89<9 hrf">sdkpege  Notepn_p cquest_que8tl(eIOCTLC92ri36cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
=66omment">/*s_a} } el"lin_34" _te_fbl r_sizifs_cev_a} } el"lin_34" _te_7ref>=765="[0]+coe=sdscsi2="L_NOTIC2 Note_fblk_ioctl(sdkpege  No81_9ndex_id8ctl(>=735="[058(sdkpege  Note_fblk_i8i3c+csss/s8sierroras ="3rivers/scerr8rclas89 Notepn_p q_ttlELl(EL="srL
512.\n&quY""6L11>=64 translT_UNI/scgdsdkpege  Note_fbl queueoctl(sdkpegese.age97clrt97cop_fblrss="sref">sdkpege  Note_fblk_i8ipncev_ge18asL
512.\n"134" clcl8ss="l89sdkpege  NotepnTYPE_Mbl c/i_ioctl(scsdolc_fbls9i
=745="[0]8i" i3c+css8   3
7a9p  06ref>=69ref="8nef="89put_device"putblk1/a ref"c 4nr _d 38ef"="+code8scsi_deeare"6nsssssssssss8sssss89=67" class="69">1149
scsi_aelse lass="lin=7 3ame="L1179ef"lNOTICE74" class="7L119ef"lNOTICEL1194"203ri>203" i3c+cs"7class="sr922
)WARNINGclas"">sdkpege  Notepi1eef"="+co8ex_idactl<8=6cla>=69="+code=scsi_8ev8ce85g89IC2ou1_free_9ndexl(203" i3c+cs"7class="sr922
sdkpege  Notepi1eef"="+co91#L11e  No9apacity0" clascla" name==999ame9"Le=6/a>      9 hdr *93ri"6/a>>=999="[0]+co9=sd9#L1110" i3s/scsi Notl9" nam9092ri=i_ioctl(scsdolc_fblrefL
512.\n"134" clclass="912="[0]+co9=a_spin_c#L1lass=tor_sscs9f">sd90_ioclass=" i3c+csss/scsif1eeioctl} el"2.\fbl r_sizifs_cev_a} } el"p     938paterror9   =7/aname==74name="Le=7ref"lwnes9i
=745="[0]9>      9 1998<9ruc"7=745="[0]9>4     9 199spin_unc#L1lass=tor_sscs9 namd90 /s pascsi2="L_NOTIC2erroras ="3rive9ref=70cood9=sdp" cl8evice85goto#scsi9="L_N90obr_domainfblk_ioctl(fsssdessf"9x#L11e  No9apacity0" clascla" name==9 name90f=9"+c=7cla>=75ommen=scsi_d/99139">119i
=64vers/s905="[0]+co9=sd9#L1110" i3s/scsi Notl9" nam90function 8s 9rvokedwfrom t"rrscla m1ref_sd - en3ryan2.n3 classa11349* t" (bothle.134ass="m1r or e.13139">119i
=64vers/s908="[0]+co9=csi_deeare"6nsssssssssss9114291142sd9pege  Note_fbl ck_ioctl(=65/sd.cscsi/sd.9#L11996"sref "*#Lthc#L
i" registla>#sa11349* t" withllass="lin=75name="L107class="sr9>6thengniz9"2r07cla>=75 9sdkpege  N9te_fbl 9ndexl(>=75lsD_F=sdp" cl9s;exit-er".n3thc#L
i" pan3table.1349="L_NOTIC291ote_fblk_ioctl(sdk91TIC2f7cla>=76lsD_F=sdp" cl9ss="__1refkpege f1eef"="+__1refas /a"lin=76name="L11ref_sdkpege f1eef"="+1ref_sd   93voidrss="sref">sdkpege  Note_fblk_i9=      9 19ctl(s9kpege91tor_ssd.6="sref">sdkpege cevl(sdkpege  Notemajorfput_dev ]+coe=sdscsi2="L_Nkpege f1eef"="+1L1194"203ri>203" i3c+ers/scpu1#L11:  Nocapput_s9i
=745="[0]9eoctl(9a c+c cquest_queueclasf">9dkpeg91obr_domainfblk_ioctl(fsssdessf"9ege  Notep9_ptypeas ="3rivers/sctype9ass !91catalass"nege  Note_fbl c/i_ef">_LOG_HLQUEUE74" class="7L11ef">_LOG_HLQUEUE   9334"203ri>203" i3c+porclase93"sref">scsilse lass="li)WARNINGces9i
=745="[0]9s5="[0]+co9a>(sd91put_device"putblk1/a ref"c 4nr _d 39n"1349 clclass="lin=7c7ame="Le=9ref"l9nes9s7paterrorclas38paterror9   =7Nkpege f1eef"="+1L119dev  +coe=sdscsi2="L_Nkpege f1eef"="+1L119nwa gueue_ q_timeoutlassMAJORL1194"2L196put_devicAJORLput_s+coe=sdscsi2="L_Nkpege f1eef"="+1L119++rss="sref">sdkpege  Note_fblk_i9=0" cl9"+code=scsi_deearef">sdkp9ge  N9tepn_p cquest_queueoctref"lwnes9     )WARNINGc =ev rss="sref">sdkpege  Note_fblk_i903333333339csi_8evice858v" cl86sdkpe9e  No92=7/9ame="Le=7>sdkpege  Note_froras ="3riversmajorf">sdkpege  Notemajorfput_++s9i
=745="[0]9clasL
512.9n"134" clclass="lin=92name921s9s79i
=745="[0]9c"L_NOTIC29=sd9#L1110" i3s/scsi Notl9" nam92TIC2f1_9ndex_tlELl(sdkpege  Notemajorfput_rss="sref">sdkpege  Note_fblk_i90      9 19="L_NOTIC2f1ote_fblk_ioct9(929="L*/97e=out" claser/a>    en_>20en" class="line69name="L10689CONFIG_9>t = <9flu0689C>=67/sd.c#L1112"9clas.pege 9Note_fbl paran2
a href="29iverp92" class="sref">sdkpege  Note_fblk_i9l<_ioctl(203" i3c+ers/scpu1#L11:  Nocapput_devroras ="3riverscpu1#_registla/scpu1#L11:  Nocpu1#_registla   93class="lin=74name="L107} el"cpu1#
512.\n"13499} el"cpu1#"lwnes9i
=745="[0]9">sdkpege 9Notepkevsn i9l(sdkpege  Note_fblk_i905="[0]+co9sLL
512.\n"134" clcl9ss="l929="L*/97e=out" claserbl c/i_ioctl(t = <9flu0689C>=67/sd.c#L1112"9c"1349="L_NOTIC2f1ote_fblk_ioct9(9a ref"> = <9flu0689C>=67/sd.c#L1112"9c0" cl9de=scsi_8evice85goto#scsi9="L_N92IC2ou1_free_9ndexl(nthengniz9((=745="[0]9free_9ndex9L11e  Nocapacity0" clascl9" nam93TIC2f1_9ndex_tlsdkpege  Note_fblk_i9si2="L_NOT9C2ge1_c/iblk_ioctl((t = <9flu0689C>=67/sd.c#L1112"9catalass"n9ge  Note_fbl c/i_ioctlsdkpege  Notepi1en>, sdkpege  Note_fbl c/i_io_cdb_/i3="ss/scsif1eef"="+cocdb_/i3="put_devroras ="3riverskmem_/i3="_creld" i3c+csss/scsifkmem_/i3="_creld"ss="lisdkpege  Notepi1en>, sdkpege  Notepi1en>, sdkpege  Notepn_p cquest_que9br_domain 9efLe  Nocapacity0" clascl9" nam93sdkpege  NotepnTYPE_M_F=sdp" cl9ss="porclase93"sref">scsilse lass="lin=7 3ame="L1179ef"lERR74" class="7L119ef"lERRas /a")WARNINGclas"">sdkpege  Notepi1eef"="+co92.\n"934" clclass="lin=7/name="9107/a939="L*/97e=out" claserbl c/i_ioctl(t = <9flu0689C>=67/sd.c#L1112"9c"1349da0e  Nocapacity0" clascl9" nam93=67" class="6TIC2ou1_pu1as ="3rivers/scpu1_p920" cl9=7cla>=73f="[0#scsi9="L_N9374name="Le=7L1189">119i1142((=72dp=72dp203" i3c+cs_cdb_/i3="ss/scsif1eef"="+cocdb_/i3="put_ra> = <9flu0689C>=67/sd.c#L1112"9TIC2f1_9nd9x_idactl(=72dpsdkpege  Notepn_p cquest_que9((scsilse lass="lin=7 3ame="L1179ef"lERR74" class="7L119ef"lERRas /a"sdkpege  Notepi1eef"="+co9lass="7L1199">119i        i9DY""7L119=74 t949="L*/97e=out" claserbl c/i_ioctl((9a c+c94TIC2f1_9ndex_c9i
=745="[0]911537ref"l9nes9inthengniz9f="37ref>=944p(fsssdessf"9coe=sdscsi9="L_NOTIC2kfreeoctl(<9 c+ck94sdkpege  Note/a>      9f
>=735="[059T.\n"9L107L1189">119i6thengniz99  07L94put_device"putblk1/a ref"c 4nr _d 3989">119i
<9 href=9* t"7L11>=747ef="I9ef="+94es9s7i_ioctl(9ase  Nocapacity0" clascla9 name94IC2ou1_free_9ndexl( = <9flu0689C>=67/sd.c#L1112"9=7L11>=74i9sd.9#L1110" i3s/scsi Notl9" nam95Le=6/a>      9 hdr *93ri"6/a>>=9ascla" nam9==75name="Le=79">1149(t=745="[0]9d.9#L119999ref=="*      essf"obr) is9detac959="L*i_ioctl(tsdkpege  Note_fblk_i991537ref"l9de=sdp" cl9ss="s99ss="s="9     95OTIC2f1_kp" __________F=sdp" cl9ss="unregistla_blkdscsi2="L_NOTIC2 Nunregistla_blkdsc   938paterror9   =7/a_major
512.\n"13499major   938paterror9   =7Nkpege f1eef"="+1L119),7(    203ri>203" i3c+ers/scpu1#L11:  Nocapput_s9i
=745="[0]9e.\n"99e" na91 href="3si/sd2Not9: thi959="L*c9i
=745="[0]9d9">119i
<9ref=="3      This functio9 potr95 ref"> = <9flu0689C>=67/sd.c#L1112"9>=75i/sd.c9L1189"9i2="L98ss="s="c   9  tha95could be re-used by a  ubsc/99139">119i
=64vers/s9="*      T9is function is not cilled9when 96 *9ruc"6cla>=65/sd.cscsi/sd.9#L1199sr9r_sd - er9ran2.n3 classa11349* t" (e.1344" cl a"""*1135name="Le=7class="sr9>1142>=75lsD_F=sdp" cl9same="Le=7class="sr9>1142devec/iblk_ioctl=65/sd.cscsi/sd.9#L11996"sref "*#Lthc#L
i" unregistla>#sa11349* t" 34" llass="lin=75name="L107class="sr9>6thengniz9"2r07cla>=75 9rmax_csev=9sr1csi/sd.c#L11*1134" cla9s="li96d from t"rrsystem. It is oi9s;exit-er".n3thc#L
i" pan3table.1349="2r"7L11>9vef"d_blk_ioctl(=7voidsr92< Leent">9eD__sr9rsi2="L_NOTIC2 N__sr9ras /a"lin=76name="L1sr9r_sd/scpu1#L11:  Nocxef_sd   93voidrss="sref">sdkpege  Note_fblk_i9ctl(sdkpege  Notepn_p cquest_que9epncev_ge19drvcata_ioctl(=745="[0]9=" i3c+css9/scsiy >sdkpege  bout e_F9sda3196put_device"putblk1/a ref"c 4nr _d 39able.134" 9lass="lin=66name="Le=6cl691149
_LOG_HLQUEUE74" class="7L11ef">_LOG_HLQUEUE   9334"203ri>203" i3c+porclase93"sref">scsilse lass="li1199        s9=668ef9"Inef9674name="Le=7L1189">119i1142      99hdr *9   "6/a>>=66/sd9c#L1297TIC2f1_9ndex_c#L1ctl(=72dp=745="[0]9/class="li9lase  Nocapacity0" clascl9" nam97=7 name="L1179">1149<203
 = <9flu0689C>=67/sd.c#L1112"9i3cap_st1_9a>  erroras ="3rivers/sce9rorcl97sclas"">sdkpege  Notepi1en>, sdkpege  Note_fbl c/i_i_a} unregistla_689C>=fbl r_sizifs_cev_a} unregistla_689C>=   93class="lin=74name="L107templld" i3c+csss/scsif107templld"n&ques9>nthengniz9((=745="[0]9wnes9>2
=67/sd.c#L1994"2097SI disk/(sd) c+csss/scsif1eecpu1#_unregistla/scpu1#L11:  Nocpu1#_unregistla   93class="lin=74name="L107} el"cpu1#
512.\n"13499} el"cpu1#"lwnes9i
=745="[0]9vers/scpu19L11e  Nocapacity0" clascl9" nam97obr_domainfblk_ioctl(fsssdessf"9wpncev_ge19ref"k/a>)INFOf"="+code=sc9i_k/a97sdkpege  Noteclas38paterror9   =7Nkpege f1eef"="+1L119dev  +coe=sdscsi2="L_Nkpege f1eef"="+1L119nwa gueue_ q_timeoutlassMAJORL1194"2L196put_devicAJORLput_s+coe=sdscsi2="L_Nkpege f1eef"="+1L119++rss="sref">sdkpege  Note_fblk_i9/" i3c+css9de=ou888v" cl866666666666966666979="L*/97e=out" claser_F=sdp" cl9ss="unregistla_blkdscsi2="L_NOTIC2 Nunregistla_blkdsc   938paterror9   =7/a_major
512.\n"13499major   938paterror9   =7Nkpege f1eef"="+1L119),7(1199scsierroras ="3rivers/sce9rorcl9774name="Le=7L1189">119i1142sdkpege  9ote_fblk_ioctl(sd98TIC2fc#L1ctl(=745="[0]963cap_st1_9 = <9_by06cla>=68/sd.c#L1912"2098sclas"">sdkpege  Notepi1en>, =7voidsr92< Leent">9eDEo_rorcl sense_hds/scpu1#L11:  NoEsrrorcl sense_hdsNocap class="lin=76name="L1E"7cla>=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
sdkpege  Notepi1en>, 2
sdkpege  Notepi1en>, 
=98cood98=7615f">sdkpege  Notepn_p cquest_que91pncev_ge19L11>=68omment">/*scsi_aelse lass="lin=7 3ame="L1179ef"lINFO74" class="7L119ef"lINFOL1194"203ri>203" i3c+cs"7class="sr922
sdkpege  Notepi1eef"="+co91uot;assum9tor_siziref=la" name==68"9class98=67" class="69">1149
scsi_aelse lass="lin=7 3ame="L1179ef"lINFO74" class="7L119ef"lINFOL1194"203ri>203" i3c+cs"7class="sr922
1199a>(sd98IC2ou1_free_9ndexl((203" i3c+cshds/scpu1#L11:  NoEshdsas / queueoctl(sdkpege  Notepi1eef"="+co92ri"6cla>=98/sd.c#L1200"203ri>20333393333g99 *9ruascsi2="L_NOTIC2erroras ="3rive9/scpu1_pu19L11e  Nocapacity0" clascl9" nam991s9s79i
=745="[0]9tl(=7voidsr92< Leent">9eDEo_rorcl resultclass="sr922
=76dkp" 3"sref">scsi_a} else lass="lin=76" class="7class="sr922
sdkpege  Notepi1en>, (sdkpege cevl((scsi_aelse lass="lin=7 3ame="L1179ef"lINFO74" class="7L119ef"lINFOL1194"203ri>203" i3c+cs"7class="sr922
203" i3c+E"7clshowlresultclass="sr922
=69ref="9nef="99put_device"putblk1/a ref"c 4nr _d 39ef"="+code9scsi_deeare"6nsssssssssss9sssss99=67" 
The original LXR software byllassvice"putbhttp://sourceforge.net/projects/lxa/>LXR It urefyf92r,7sa113experi is al /a r i" bylvice"putbmailto:lxa@"6nux.no">lxa@"6nux.non&que
lxa."6nux.no kindly hostld bylvice"putbhttp://www.redpill-"6npro.no">Redpill L6npro ALs="07/provider of L6nux Insult""""e.13operaL i"s serlasLs since 199O.