linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@gmail.com>
To: Linux FS Devel <linux-fsdevel@vger.kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Luca Tettamanti <kronos.it@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 04/21] procfs: drop vmtruncate
Date: Fri, 31 Aug 2012 15:53:00 +0200	[thread overview]
Message-ID: <5040C1BC.4080102@gmail.com> (raw)

Removed vmtruncate.

Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---
 fs/proc/base.c        |    3 ++-
 fs/proc/generic.c     |    3 ++-
 fs/proc/proc_sysctl.c |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 1b6c84c..36fa9dd 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -545,9 +545,10 @@ int proc_setattr(struct dentry *dentry, struct iattr *attr)
 
 	if ((attr->ia_valid & ATTR_SIZE) &&
 	    attr->ia_size != i_size_read(inode)) {
-		error = vmtruncate(inode, attr->ia_size);
+		error = inode_newsize_ok(inode, attr->ia_size);
 		if (error)
 			return error;
+		truncate_setsize(inode, attr->ia_size);
 	}
 
 	setattr_copy(inode, attr);
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index b3647fe..d471d2f 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -263,9 +263,10 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
 
 	if ((iattr->ia_valid & ATTR_SIZE) &&
 	    iattr->ia_size != i_size_read(inode)) {
-		error = vmtruncate(inode, iattr->ia_size);
+		error = inode_newsize_ok(inode, iattr->ia_size);
 		if (error)
 			return error;
+		truncate_setsize(inode, iattr->ia_size);
 	}
 
 	setattr_copy(inode, iattr);
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index dfafeb2..5c484f8 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -740,9 +740,10 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
 
 	if ((attr->ia_valid & ATTR_SIZE) &&
 	    attr->ia_size != i_size_read(inode)) {
-		error = vmtruncate(inode, attr->ia_size);
+		error = inode_newsize_ok(inode, attr->ia_size);
 		if (error)
 			return error;
+		truncate_setsize(inode, attr->ia_size);
 	}
 
 	setattr_copy(inode, attr);
-- 
1.7.3.4

             reply	other threads:[~2012-08-31 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 13:53 Marco Stornelli [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-20 12:17 [PATCH 04/21] procfs: drop vmtruncate Marco Stornelli
2012-10-24 15:12 ` Christoph Hellwig
2012-10-24 16:02   ` Marco Stornelli
2012-11-03  9:24 Marco Stornelli
2012-12-15 10:48 Marco Stornelli

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=5040C1BC.4080102@gmail.com \
    --to=marco.stornelli@gmail.com \
    --cc=kronos.it@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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;
as well as URLs for NNTP newsgroup(s).