X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Ffile.c;h=eb56a13dab3ed5561a9521b2b2d1a6000a7158a3;hb=HEAD;hp=60a45e9f53231379c87b9ee75cb64eb8d6d71979;hpb=084c6c5013af3c62f1c344435214496f5ac999f2;p=~andy%2Flinux diff --git a/fs/file.c b/fs/file.c index 60a45e9f532..eb56a13dab3 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; } /*