DEVEL15-linux-call-inode-setattr-op-20090622
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 22 Jun 2009 16:25:32 +0000 (16:25 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 22 Jun 2009 16:25:32 +0000 (16:25 +0000)
LICENSE IPL10
FIXES 124942

call inode's setattr op instead of just inode_setattr, when one is available.
needed for xfs, notably also will cause truncates to be journalled for ext3,
which may solve some existing issues

(cherry picked from commit b02e22b5f0590929ef9120da4799ca9a47fa3aeb)

src/afs/LINUX/osi_file.c

index 479b519..fe0eef1 100644 (file)
@@ -281,9 +281,14 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
     code = inode_change_ok(inode, &newattrs);
     if (!code)
 #ifdef INODE_SETATTR_NOT_VOID
-       code = inode_setattr(inode, &newattrs);
+#if defined(AFS_LINUX26_ENV)
+       if (inode->i_op && inode->i_op->setattr)
+           code = inode->i_op->setattr(afile->filp->f_dentry, &newattrs);
+       else
+#endif
+           code = inode_setattr(inode, &newattrs);
 #else
-       inode_setattr(inode, &newattrs);
+        inode_setattr(inode, &newattrs);
 #endif
     unlock_kernel();
     if (!code)