~ubuntu-branches/ubuntu/trusty/iscsitarget/trusty

« back to all changes in this revision

Viewing changes to kernel/target_disk.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-05-17 11:33:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080517113355-gzmh2h3dleqe1qno
Tags: 0.4.15+svn148-2.1ubuntu1
* Merge from debian unstable, remaining changes:
  - Update kernel modules to build for several architectures.
  - Fixed init script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        unsigned char geo_m_pg[] = {0x04, 0x16, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
67
67
                                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68
68
                                    0x00, 0x00, 0x00, 0x00, 0x3a, 0x98, 0x00, 0x00};
69
 
        u32 ncyl, *p;
 
69
        u32 ncyl;
 
70
        u32 n;
70
71
 
71
72
        /* assume 0xff heads, 15krpm. */
72
73
        memcpy(ptr, geo_m_pg, sizeof(geo_m_pg));
73
74
        ncyl = sec >> 14; /* 256 * 64 */
74
 
        p = (u32 *)(ptr + 1);
75
 
        *p = *p | cpu_to_be32(ncyl);
 
75
        memcpy(&n, ptr+1, sizeof(u32));
 
76
        n = n | cpu_to_be32(ncyl);
 
77
        memcpy(ptr+1, &n, sizeof(u32));
76
78
        return sizeof(geo_m_pg);
77
79
}
78
80
 
249
251
        struct iet_volume *lun;
250
252
        int rest, idx = 0;
251
253
 
252
 
        size = be32_to_cpu(*(u32 *)&req->scb[6]);
 
254
        size = (u32)req->scb[6] << 24 | (u32)req->scb[7] << 16 |
 
255
                (u32)req->scb[8] << 8 | (u32)req->scb[9];
253
256
        if (size < 16)
254
257
                return -1;
255
258