vmur.c (ecd740c6f2f092b90b95fa35f757973589eaaca2) | vmur.c (b25472f9b96159cc0b9b7ed449448805973cd789) |
---|---|
1/* 2 * Linux driver for System z and s390 unit record devices 3 * (z/VM virtual punch, reader, printer) 4 * 5 * Copyright IBM Corp. 2001, 2009 6 * Authors: Malcolm Beattie <beattiem@uk.ibm.com> 7 * Michael Holzheu <holzheu@de.ibm.com> 8 * Frank Munzert <munzert@de.ibm.com> --- 768 unchanged lines hidden (view full) --- 777 wake_up_interruptible(&urf->urd->wait); 778 urdev_put(urf->urd); 779 urfile_free(urf); 780 return 0; 781} 782 783static loff_t ur_llseek(struct file *file, loff_t offset, int whence) 784{ | 1/* 2 * Linux driver for System z and s390 unit record devices 3 * (z/VM virtual punch, reader, printer) 4 * 5 * Copyright IBM Corp. 2001, 2009 6 * Authors: Malcolm Beattie <beattiem@uk.ibm.com> 7 * Michael Holzheu <holzheu@de.ibm.com> 8 * Frank Munzert <munzert@de.ibm.com> --- 768 unchanged lines hidden (view full) --- 777 wake_up_interruptible(&urf->urd->wait); 778 urdev_put(urf->urd); 779 urfile_free(urf); 780 return 0; 781} 782 783static loff_t ur_llseek(struct file *file, loff_t offset, int whence) 784{ |
785 loff_t newpos; 786 | |
787 if ((file->f_flags & O_ACCMODE) != O_RDONLY) 788 return -ESPIPE; /* seek allowed only for reader */ 789 if (offset % PAGE_SIZE) 790 return -ESPIPE; /* only multiples of 4K allowed */ | 785 if ((file->f_flags & O_ACCMODE) != O_RDONLY) 786 return -ESPIPE; /* seek allowed only for reader */ 787 if (offset % PAGE_SIZE) 788 return -ESPIPE; /* only multiples of 4K allowed */ |
791 switch (whence) { 792 case 0: /* SEEK_SET */ 793 newpos = offset; 794 break; 795 case 1: /* SEEK_CUR */ 796 newpos = file->f_pos + offset; 797 break; 798 default: 799 return -EINVAL; 800 } 801 file->f_pos = newpos; 802 return newpos; | 789 return no_seek_end_llseek(file, offset, whence); |
803} 804 805static const struct file_operations ur_fops = { 806 .owner = THIS_MODULE, 807 .open = ur_open, 808 .release = ur_release, 809 .read = ur_read, 810 .write = ur_write, --- 260 unchanged lines hidden --- | 790} 791 792static const struct file_operations ur_fops = { 793 .owner = THIS_MODULE, 794 .open = ur_open, 795 .release = ur_release, 796 .read = ur_read, 797 .write = ur_write, --- 260 unchanged lines hidden --- |