Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (3 months ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/block/nbd.c

    r31574 r31885  
    5555        struct mutex tx_lock;
    5656        struct gendisk *disk;
    57         int blksize;
     57        loff_t blksize;
    5858        loff_t bytesize;
    5959
     
    127127
    128128static int nbd_size_set(struct nbd_device *nbd, struct block_device *bdev,
    129                         int blocksize, int nr_blocks)
     129                        loff_t blocksize, loff_t nr_blocks)
    130130{
    131131        int ret;
     
    136136
    137137        nbd->blksize = blocksize;
    138         nbd->bytesize = (loff_t)blocksize * (loff_t)nr_blocks;
     138        nbd->bytesize = blocksize * nr_blocks;
    139139
    140140        nbd_size_update(nbd, bdev);
     
    649649        case NBD_SET_SIZE:
    650650                return nbd_size_set(nbd, bdev, nbd->blksize,
    651                                     arg / nbd->blksize);
     651                                        div_s64(arg, nbd->blksize));
    652652
    653653        case NBD_SET_SIZE_BLOCKS:
     
    818818        debugfs_create_u64("size_bytes", 0444, dir, &nbd->bytesize);
    819819        debugfs_create_u32("timeout", 0444, dir, &nbd->tag_set.timeout);
    820         debugfs_create_u32("blocksize", 0444, dir, &nbd->blksize);
     820        debugfs_create_u64("blocksize", 0444, dir, &nbd->blksize);
    821821        debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_ops);
    822822
Note: See TracChangeset for help on using the changeset viewer.