Skip to contentSkip to conversation

procfs: drop vmtruncate

PATCH In review Marco Stornelli 1 participant 1 message Dec 15, 2012

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

PATCH 4/21 procfs: drop vmtruncate

Removed vmtruncate

---
 fs/proc/base.c        |    7 -------
 fs/proc/generic.c     |    9 +--------
 fs/proc/proc_sysctl.c |    7 -------
 3 files changed, 1 insertions(+), 22 deletions(-)
fs/proc/base.c +0 -7
index aa63d25..c88e14a 100644
@@ -542,13 +542,6 @@ int proc_setattr(struct dentry *dentry, struct iattr *attr)
 	if (error)
 		return error;
 
-	if ((attr->ia_valid & ATTR_SIZE) &&
-	    attr->ia_size != i_size_read(inode)) {
-		error = vmtruncate(inode, attr->ia_size);
-		if (error)
-			return error;
-	}
-
 	setattr_copy(inode, attr);
 	mark_inode_dirty(inode);
 	return 0;
fs/proc/generic.c +1 -8
index 0d80cef..0c00b63 100644
@@ -261,16 +261,9 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
 	if (error)
 		return error;
 
-	if ((iattr->ia_valid & ATTR_SIZE) &&
-	    iattr->ia_size != i_size_read(inode)) {
-		error = vmtruncate(inode, iattr->ia_size);
-		if (error)
-			return error;
-	}
-
 	setattr_copy(inode, iattr);
 	mark_inode_dirty(inode);
-	
+
 	de->uid = inode->i_uid;
 	de->gid = inode->i_gid;
 	de->mode = inode->i_mode;
fs/proc/proc_sysctl.c +0 -7
index 701580d..1827d88 100644
@@ -736,13 +736,6 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
 	if (error)
 		return error;
 
-	if ((attr->ia_valid & ATTR_SIZE) &&
-	    attr->ia_size != i_size_read(inode)) {
-		error = vmtruncate(inode, attr->ia_size);
-		if (error)
-			return error;
-	}
-
 	setattr_copy(inode, attr);
 	mark_inode_dirty(inode);
 	return 0;
Signature · 1 line
1.7.3.4