public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Carsten Otte <cotte@de.ibm.com>
To: cotte@freenet.de
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	schwidefsky@de.ibm.com, akpm@osdl.org
Subject: [RFC/PATCH 5/5] madvice/fadvice: add execute in place support
Date: Wed, 11 May 2005 16:30:35 +0200	[thread overview]
Message-ID: <4282170B.8060907@de.ibm.com> (raw)

[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...

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
---
diff -ruN linux-2.6-git/mm/fadvise.c linux-2.6-git-xip/mm/fadvise.c
--- linux-2.6-git/mm/fadvise.c	2005-05-10 11:17:27.000000000 +0200
+++ linux-2.6-git-xip/mm/fadvise.c	2005-05-10 13:39:55.886811280 +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-2.6-git/mm/madvise.c linux-2.6-git-xip/mm/madvise.c
--- linux-2.6-git/mm/madvise.c	2005-05-10 11:17:27.000000000 +0200
+++ linux-2.6-git-xip/mm/madvise.c	2005-05-10 13:39:55.894810064 +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;



                 reply	other threads:[~2005-05-11 14:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4282170B.8060907@de.ibm.com \
    --to=cotte@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=cotte@freenet.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox