aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 22:02:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 22:02:39 -0400
commitbbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (patch)
tree12b2bb4202b05f6ae6a43c6ce830a0472043dbe5 /drivers/char
parent8e204874db000928e37199c2db82b7eb8966cc3c (diff)
parent5a9a43646cf709312d71eca71cef90ad802f28f9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits) vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp isofs: Remove global fs lock jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory fix IN_DELETE_SELF on overwriting rename() on ramfs et.al. mm/truncate.c: fix build for CONFIG_BLOCK not enabled fs:update the NOTE of the file_operations structure Remove dead code in dget_parent() AFS: Fix silly characters in a comment switch d_add_ci() to d_splice_alias() in "found negative" case as well simplify gfs2_lookup() jfs_lookup(): don't bother with . or .. get rid of useless dget_parent() in btrfs rename() and link() get rid of useless dget_parent() in fs/btrfs/ioctl.c fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers drivers: fix up various ->llseek() implementations fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek Ext4: handle SEEK_HOLE/SEEK_DATA generically Btrfs: implement our own ->llseek fs: add SEEK_HOLE and SEEK_DATA flags reiserfs: make reiserfs default to barrier=flush ... Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new shrinker callout for the inode cache, that clashed with the xfs code to start the periodic workers later.
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/generic_nvram.c4
-rw-r--r--drivers/char/nvram.c2
-rw-r--r--drivers/char/ps3flash.c13
3 files changed, 17 insertions, 2 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index 0e941b57482e..6c4f4b5a9dd3 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -34,12 +34,16 @@ static ssize_t nvram_len;
34static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) 34static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
35{ 35{
36 switch (origin) { 36 switch (origin) {
37 case 0:
38 break;
37 case 1: 39 case 1:
38 offset += file->f_pos; 40 offset += file->f_pos;
39 break; 41 break;
40 case 2: 42 case 2:
41 offset += nvram_len; 43 offset += nvram_len;
42 break; 44 break;
45 default:
46 offset = -1;
43 } 47 }
44 if (offset < 0) 48 if (offset < 0)
45 return -EINVAL; 49 return -EINVAL;
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 166f1e7aaa7e..da3cfee782dc 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -224,6 +224,8 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
224 case 2: 224 case 2:
225 offset += NVRAM_BYTES; 225 offset += NVRAM_BYTES;
226 break; 226 break;
227 default:
228 return -EINVAL;
227 } 229 }
228 230
229 return (offset >= 0) ? (file->f_pos = offset) : -EINVAL; 231 return (offset >= 0) ? (file->f_pos = offset) : -EINVAL;
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index 85c004a518ee..d0c57c2e2909 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -101,12 +101,16 @@ static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin)
101 101
102 mutex_lock(&file->f_mapping->host->i_mutex); 102 mutex_lock(&file->f_mapping->host->i_mutex);
103 switch (origin) { 103 switch (origin) {
104 case 0:
105 break;
104 case 1: 106 case 1:
105 offset += file->f_pos; 107 offset += file->f_pos;
106 break; 108 break;
107 case 2: 109 case 2:
108 offset += dev->regions[dev->region_idx].size*dev->blk_size; 110 offset += dev->regions[dev->region_idx].size*dev->blk_size;
109 break; 111 break;
112 default:
113 offset = -1;
110 } 114 }
111 if (offset < 0) { 115 if (offset < 0) {
112 res = -EINVAL; 116 res = -EINVAL;
@@ -305,9 +309,14 @@ static int ps3flash_flush(struct file *file, fl_owner_t id)
305 return ps3flash_writeback(ps3flash_dev); 309 return ps3flash_writeback(ps3flash_dev);
306} 310}
307 311
308static int ps3flash_fsync(struct file *file, int datasync) 312static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync)
309{ 313{
310 return ps3flash_writeback(ps3flash_dev); 314 struct inode *inode = file->f_path.dentry->d_inode;
315 int err;
316 mutex_lock(&inode->i_mutex);
317 err = ps3flash_writeback(ps3flash_dev);
318 mutex_unlock(&inode->i_mutex);
319 return err;
311} 320}
312 321
313static irqreturn_t ps3flash_interrupt(int irq, void *data) 322static irqreturn_t ps3flash_interrupt(int irq, void *data)