]> err.no Git - linux-2.6/blobdiff - mm/fadvise.c
[PATCH] swsusp: userland interface
[linux-2.6] / mm / fadvise.c
index 57264d74b8bff0528dd09456c4c81d6c6785363c..d257c89e7704c60d8decf405c89c46f8de262153 100644 (file)
@@ -37,12 +37,21 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
        if (!file)
                return -EBADF;
 
+       if (S_ISFIFO(file->f_dentry->d_inode->i_mode)) {
+               ret = -ESPIPE;
+               goto out;
+       }
+
        mapping = file->f_mapping;
        if (!mapping || len < 0) {
                ret = -EINVAL;
                goto out;
        }
 
+       if (mapping->a_ops->get_xip_page)
+               /* no bad return value, but ignore advice */
+               goto out;
+
        /* Careful about overflows. Len == 0 means "as much as possible" */
        endbyte = offset + len;
        if (!len || endbyte < len)