[RFC/PATCH 5/5] madvice/fadvice: execute in place (V2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[RFC/PATCH 5/5] madvice/fadvice: execute in place (V2)
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...

This patch is unchanged from previous version.

Signed-off-by: Carsten Otte <[email protected]>
--- 
diff -ruN linux-git/mm/fadvise.c linux-git-xip/mm/fadvise.c
--- linux-git/mm/fadvise.c	2005-05-17 14:23:36.000000000 +0200
+++ linux-git-xip/mm/fadvise.c	2005-05-17 20:16:40.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-17 14:23:36.000000000 +0200
+++ linux-git-xip/mm/madvise.c	2005-05-17 20:16:40.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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux