summaryrefslogtreecommitdiff
path: root/fs/file.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-04-09 17:50:02 +0200
committerTakashi Iwai <tiwai@suse.de>2014-04-09 17:50:02 +0200
commit50487c3a4a96d91e25d43d63262773f14961d9de (patch)
tree9649437556ec56e5ba27e943313f093318b17b81 /fs/file.c
parent17c3ad030213da23158082ea90ebbe2a3940a2d2 (diff)
parentab5d6fbdb71c183add7431243c7f615c42b643bb (diff)
Merge tag 'asoc-v3.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.15 A smattering of device specific fixes, nothing stands out here except for the multiplatform fixes for Samsung and the device IDs being added by Stephen Warren - there's no real code changes from those and they give better robustness to the enumeration with DT.
Diffstat (limited to 'fs/file.c')
-rw-r--r--fs/file.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/fs/file.c b/fs/file.c
index 60a45e9f5323..eb56a13dab3e 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -713,27 +713,16 @@ unsigned long __fdget_raw(unsigned int fd)
unsigned long __fdget_pos(unsigned int fd)
{
- struct files_struct *files = current->files;
- struct file *file;
- unsigned long v;
-
- if (atomic_read(&files->count) == 1) {
- file = __fcheck_files(files, fd);
- v = 0;
- } else {
- file = __fget(fd, 0);
- v = FDPUT_FPUT;
- }
- if (!file)
- return 0;
+ unsigned long v = __fdget(fd);
+ struct file *file = (struct file *)(v & ~3);
- if (file->f_mode & FMODE_ATOMIC_POS) {
+ if (file && (file->f_mode & FMODE_ATOMIC_POS)) {
if (file_count(file) > 1) {
v |= FDPUT_POS_UNLOCK;
mutex_lock(&file->f_pos_lock);
}
}
- return v | (unsigned long)file;
+ return v;
}
/*