summaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-07-05 11:54:27 +0200
committerTakashi Iwai <tiwai@suse.de>2013-07-05 11:54:27 +0200
commit38f0ad7c90c2b2091e7d8689dde294fef27db68b (patch)
tree17742c032f74a953054a99ebc04ee6cd7ead2d9d /fs/fuse/file.c
parent8f0b3b7e222383a21f7d58bd97d5552b3a5dbced (diff)
parent70a9f8797ce298544cfd07328ff59f00488bc491 (diff)
downloadop-kernel-dev-38f0ad7c90c2b2091e7d8689dde294fef27db68b.zip
op-kernel-dev-38f0ad7c90c2b2091e7d8689dde294fef27db68b.tar.gz
Merge tag 'asoc-v3.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v3.11 A few small fixes, all driver specific. The removal of the GPIO based pinmuxing is a bug fix, since the obsolete nodes had been removed from the DT it stopped the driver loading.
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index e570081..35f2810 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2470,13 +2470,16 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
.mode = mode
};
int err;
+ bool lock_inode = !(mode & FALLOC_FL_KEEP_SIZE) ||
+ (mode & FALLOC_FL_PUNCH_HOLE);
if (fc->no_fallocate)
return -EOPNOTSUPP;
- if (mode & FALLOC_FL_PUNCH_HOLE) {
+ if (lock_inode) {
mutex_lock(&inode->i_mutex);
- fuse_set_nowrite(inode);
+ if (mode & FALLOC_FL_PUNCH_HOLE)
+ fuse_set_nowrite(inode);
}
req = fuse_get_req_nopages(fc);
@@ -2511,8 +2514,9 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
fuse_invalidate_attr(inode);
out:
- if (mode & FALLOC_FL_PUNCH_HOLE) {
- fuse_release_nowrite(inode);
+ if (lock_inode) {
+ if (mode & FALLOC_FL_PUNCH_HOLE)
+ fuse_release_nowrite(inode);
mutex_unlock(&inode->i_mutex);
}
OpenPOWER on IntegriCloud