]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/block_dev.c
[PATCH 1/2] kill FMODE_NDELAY_NOW
[linux-2.6-omap-h63xx.git] / fs / block_dev.c
index 7c727523bc54a62bf6f7aa3c90a8bc7fe93b24f0..99e0ae1a4c789fff59aae0e32207755e38fa7e41 100644 (file)
@@ -1206,8 +1206,16 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
        struct block_device *bdev = I_BDEV(file->f_mapping->host);
        fmode_t mode = file->f_mode;
+
+       /*
+        * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have
+        * to updated it before every ioctl.
+        */
        if (file->f_flags & O_NDELAY)
-               mode |= FMODE_NDELAY_NOW;
+               mode |= FMODE_NDELAY;
+       else
+               mode &= ~FMODE_NDELAY;
+
        return blkdev_ioctl(bdev, mode, cmd, arg);
 }