* [PATCH 04/22] procfs: drop vmtruncate
@ 2012-10-06 8:13 Marco Stornelli
2012-10-13 16:17 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Marco Stornelli @ 2012-10-06 8:13 UTC (permalink / raw)
To: Al Viro
Cc: Anton Blanchard, Benjamin Herrenschmidt, linux-kernel,
Linux FS Devel
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 d295af9..add0944 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -544,9 +544,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 0d80cef..6e7a8a7 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 dcd56f8..69d495c 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -738,9 +738,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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 04/22] procfs: drop vmtruncate
2012-10-06 8:13 [PATCH 04/22] procfs: drop vmtruncate Marco Stornelli
@ 2012-10-13 16:17 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2012-10-13 16:17 UTC (permalink / raw)
To: Marco Stornelli
Cc: Al Viro, Anton Blanchard, Benjamin Herrenschmidt, linux-kernel,
Linux FS Devel
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-13 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-06 8:13 [PATCH 04/22] procfs: drop vmtruncate Marco Stornelli
2012-10-13 16:17 ` Christoph Hellwig
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).