mlx4_core: INIT/CLOSE port logic for IB ports in SR-IOV mode
[cascardo/linux.git] / mm / fadvise.c
index 469491e..9b75a04 100644 (file)
@@ -93,11 +93,6 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
                spin_unlock(&file->f_lock);
                break;
        case POSIX_FADV_WILLNEED:
-               if (!mapping->a_ops->readpage) {
-                       ret = -EINVAL;
-                       break;
-               }
-
                /* First and last PARTIAL page! */
                start_index = offset >> PAGE_CACHE_SHIFT;
                end_index = endbyte >> PAGE_CACHE_SHIFT;
@@ -106,12 +101,13 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
                nrpages = end_index - start_index + 1;
                if (!nrpages)
                        nrpages = ~0UL;
-               
-               ret = force_page_cache_readahead(mapping, file,
-                               start_index,
-                               nrpages);
-               if (ret > 0)
-                       ret = 0;
+
+               /*
+                * Ignore return value because fadvise() shall return
+                * success even if filesystem can't retrieve a hint,
+                */
+               force_page_cache_readahead(mapping, file, start_index,
+                                          nrpages);
                break;
        case POSIX_FADV_NOREUSE:
                break;