Skip to contentSkip to conversation

madvice/fadvice: add execute in place support

PATCH In review Carsten Otte 1 participant 1 message May 11, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 5/5 madvice/fadvice: add execute in place support

[RFC/PATCH 5/5] madvice/fadvice: add execute in place support This patch makes sys_madvice and sys_fadvice return 0 on advices to cache data assoctiated with files that do have get_xip_page. Since the data for those is in memory anyway, we can just ignore the advice...

---

mm/fadvise.c +4 -0
diff -ruN linux-2.6-git/mm/fadvise.c linux-2.6-git-xip/mm/fadvise.c
@@ -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)
mm/madvise.c +4 -0
diff -ruN linux-2.6-git/mm/madvise.c linux-2.6-git-xip/mm/madvise.c
@@ -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;