|
|
Subscribe / Log in / New account

madvice/fadvice: execute in place (3rd version)

From:  Carsten Otte <cotte@de.ibm.com>
To:  linux-kernel@vger.kernel.org
Subject:  [RFC/PATCH 4/4] madvice/fadvice: execute in place (3rd version)
Date:  Mon, 23 May 2005 19:30:42 +0200
Cc:  linux-fsdevel@vger.kernel.org, schwidefsky@de.ibm.com, akpm@osdl.org, Christoph Hellwig <hch@infradead.org>

[RFC/PATCH 4/4] madvice/fadvice: execute in place (3rd version)

Make sys_madvice/fadvice return sane with xip. Patch is unchanged from
previous version.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
--- 
diff -ruN linux-git/mm/fadvise.c linux-git-xip/mm/fadvise.c
--- linux-git/mm/fadvise.c	2005-05-23 13:51:17.000000000 +0200
+++ linux-git-xip/mm/fadvise.c	2005-05-23 17:55:49.000000000 +0200
@@ -43,6 +43,10 @@
 		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)
diff -ruN linux-git/mm/madvise.c linux-git-xip/mm/madvise.c
--- linux-git/mm/madvise.c	2005-05-23 13:51:17.000000000 +0200
+++ linux-git-xip/mm/madvise.c	2005-05-23 17:55:49.000000000 +0200
@@ -65,6 +65,10 @@
 	if (!file)
 		return -EBADF;
 
+	if (file->f_mapping->a_ops->get_xip_page)
+		/* no bad return value, but ignore advice */
+		return 0;
+
 	start = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
 	if (end > vma->vm_end)
 		end = vma->vm_end;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds