ipoib: switch to netif_napi_add_weight()
[linux-2.6-microblaze.git] / fs / fcntl.c
index f15d885..34a3faa 100644 (file)
@@ -56,11 +56,10 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
                   arg |= O_NONBLOCK;
 
        /* Pipe packetized mode is controlled by O_DIRECT flag */
-       if (!S_ISFIFO(inode->i_mode) && (arg & O_DIRECT)) {
-               if (!filp->f_mapping || !filp->f_mapping->a_ops ||
-                       !filp->f_mapping->a_ops->direct_IO)
-                               return -EINVAL;
-       }
+       if (!S_ISFIFO(inode->i_mode) &&
+           (arg & O_DIRECT) &&
+           !(filp->f_mode & FMODE_CAN_ODIRECT))
+               return -EINVAL;
 
        if (filp->f_op->check_flags)
                error = filp->f_op->check_flags(arg);