[Pvfs2-cvs] commit by mtmoore in pvfs2/src/kernel/linux-2.6: inode.c

CVS commit program cvs at parl.clemson.edu
Tue Apr 5 10:21:36 EDT 2011


Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv30595/src/kernel/linux-2.6

Modified Files:
      Tag: Orange-Branch
	inode.c 
Log Message:
follow general method for converting kernel fs' from using inode_setattr


Index: inode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/inode.c,v
diff -p -u -r1.87.8.3 -r1.87.8.4
--- inode.c	5 Apr 2011 14:15:20 -0000	1.87.8.3
+++ inode.c	5 Apr 2011 14:21:36 -0000	1.87.8.4
@@ -200,6 +200,14 @@ int pvfs2_setattr(struct dentry *dentry,
 #ifdef HAVE_INODE_SETATTR
         ret = inode_setattr(inode, iattr);
 #else
+        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, iattr);
         mark_inode_dirty(inode);
         ret = 0;



More information about the Pvfs2-cvs mailing list