diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 12:10:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 12:10:19 -0400 |
commit | 790eac5640abf7a57fa3a644386df330e18c11b0 (patch) | |
tree | 08de20bde44f59e51b91ff473a71047c2957e8c9 /drivers/char | |
parent | 0b0585c3e192967cb2ef0ac0816eb8a8c8d99840 (diff) | |
parent | 48bde8d3620f5f3c6ae9ff599eb404055ae51664 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull second set of VFS changes from Al Viro:
"Assorted f_pos race fixes, making do_splice_direct() safe to call with
i_mutex on parent, O_TMPFILE support, Jeff's locks.c series,
->d_hash/->d_compare calling conventions changes from Linus, misc
stuff all over the place."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
Document ->tmpfile()
ext4: ->tmpfile() support
vfs: export lseek_execute() to modules
lseek_execute() doesn't need an inode passed to it
block_dev: switch to fixed_size_llseek()
cpqphp_sysfs: switch to fixed_size_llseek()
tile-srom: switch to fixed_size_llseek()
proc_powerpc: switch to fixed_size_llseek()
ubi/cdev: switch to fixed_size_llseek()
pci/proc: switch to fixed_size_llseek()
isapnp: switch to fixed_size_llseek()
lpfc: switch to fixed_size_llseek()
locks: give the blocked_hash its own spinlock
locks: add a new "lm_owner_key" lock operation
locks: turn the blocked_list into a hashtable
locks: convert fl_link to a hlist_node
locks: avoid taking global lock if possible when waking up blocked waiters
locks: protect most of the file_lock handling with i_lock
locks: encapsulate the fl_link list handling
locks: make "added" in __posix_lock_file a bool
...
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ps3flash.c | 28 | ||||
-rw-r--r-- | drivers/char/tile-srom.c | 28 |
2 files changed, 5 insertions, 51 deletions
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index 8cafa9ccd43f..0b311fa277ef 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c | |||
@@ -98,32 +98,8 @@ static int ps3flash_fetch(struct ps3_storage_device *dev, u64 start_sector) | |||
98 | static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin) | 98 | static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin) |
99 | { | 99 | { |
100 | struct ps3_storage_device *dev = ps3flash_dev; | 100 | struct ps3_storage_device *dev = ps3flash_dev; |
101 | loff_t res; | 101 | return generic_file_llseek_size(file, offset, origin, MAX_LFS_FILESIZE, |
102 | 102 | dev->regions[dev->region_idx].size*dev->blk_size); | |
103 | mutex_lock(&file->f_mapping->host->i_mutex); | ||
104 | switch (origin) { | ||
105 | case 0: | ||
106 | break; | ||
107 | case 1: | ||
108 | offset += file->f_pos; | ||
109 | break; | ||
110 | case 2: | ||
111 | offset += dev->regions[dev->region_idx].size*dev->blk_size; | ||
112 | break; | ||
113 | default: | ||
114 | offset = -1; | ||
115 | } | ||
116 | if (offset < 0) { | ||
117 | res = -EINVAL; | ||
118 | goto out; | ||
119 | } | ||
120 | |||
121 | file->f_pos = offset; | ||
122 | res = file->f_pos; | ||
123 | |||
124 | out: | ||
125 | mutex_unlock(&file->f_mapping->host->i_mutex); | ||
126 | return res; | ||
127 | } | 103 | } |
128 | 104 | ||
129 | static ssize_t ps3flash_read(char __user *userbuf, void *kernelbuf, | 105 | static ssize_t ps3flash_read(char __user *userbuf, void *kernelbuf, |
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c index 2e2036e940fc..7faeb1cde97d 100644 --- a/drivers/char/tile-srom.c +++ b/drivers/char/tile-srom.c | |||
@@ -273,32 +273,10 @@ static ssize_t srom_write(struct file *filp, const char __user *buf, | |||
273 | } | 273 | } |
274 | 274 | ||
275 | /* Provide our own implementation so we can use srom->total_size. */ | 275 | /* Provide our own implementation so we can use srom->total_size. */ |
276 | loff_t srom_llseek(struct file *filp, loff_t offset, int origin) | 276 | loff_t srom_llseek(struct file *file, loff_t offset, int origin) |
277 | { | 277 | { |
278 | struct srom_dev *srom = filp->private_data; | 278 | struct srom_dev *srom = file->private_data; |
279 | 279 | return fixed_size_llseek(file, offset, origin, srom->total_size); | |
280 | if (mutex_lock_interruptible(&srom->lock)) | ||
281 | return -ERESTARTSYS; | ||
282 | |||
283 | switch (origin) { | ||
284 | case SEEK_END: | ||
285 | offset += srom->total_size; | ||
286 | break; | ||
287 | case SEEK_CUR: | ||
288 | offset += filp->f_pos; | ||
289 | break; | ||
290 | } | ||
291 | |||
292 | if (offset < 0 || offset > srom->total_size) { | ||
293 | offset = -EINVAL; | ||
294 | } else { | ||
295 | filp->f_pos = offset; | ||
296 | filp->f_version = 0; | ||
297 | } | ||
298 | |||
299 | mutex_unlock(&srom->lock); | ||
300 | |||
301 | return offset; | ||
302 | } | 280 | } |
303 | 281 | ||
304 | static ssize_t total_show(struct device *dev, | 282 | static ssize_t total_show(struct device *dev, |