[PVFS2-CVS]
commit by neill in pvfs2-1/src/kernel/linux-2.6: file.c super.c
CVS commit program
cvs at parl.clemson.edu
Fri Feb 20 18:13:46 EST 2004
Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb:/tmp/cvs-serv17717/src/kernel/linux-2.6
Modified Files:
file.c super.c
Log Message:
- attempt to honor files opened for append by setting the file position to
the end of the file at open time
[ it appears that this fixes runs of configure that generate c code, a first
step in compiling pvfs2 on pvfs2 through the vfs. i had thought the problem
was elsewhere but discovered earlier today that this was what was happening ]
- remove some commented cruft
Index: file.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/file.c,v
diff -p -u -r1.52 -r1.53
--- file.c 13 Feb 2004 19:37:26 -0000 1.52
+++ file.c 20 Feb 2004 23:13:46 -0000 1.53
@@ -46,9 +46,27 @@ int pvfs2_file_open(
{
return dcache_dir_open(inode, file);
}
+
/*
- fs/open.c: returns 0 after enforcing large file support
- if running on a 32 bit system w/o O_LARGFILE flag
+ if the file's being opened for append mode, set the file pos to
+ the end of the file when we retrieve the size (which we must
+ forcefully do here in this case, afaict atm)
+ */
+ if (file->f_flags & O_APPEND)
+ {
+ int ret = -EINVAL;
+
+ ret = pvfs2_inode_getattr(inode);
+ if (ret)
+ {
+ return ret;
+ }
+ file->f_pos = inode->i_size;
+ }
+
+ /*
+ fs/open.c: returns 0 after enforcing large file support if
+ running on a 32 bit system w/o O_LARGFILE flag
*/
return generic_file_open(inode, file);
}
Index: super.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/super.c,v
diff -p -u -r1.24 -r1.25
--- super.c 13 Feb 2004 19:37:26 -0000 1.24
+++ super.c 20 Feb 2004 23:13:46 -0000 1.25
@@ -112,9 +112,6 @@ static void pvfs2_put_inode(
(int)atomic_read(&inode->i_count),
(int)inode->i_nlink);
- /* set nlink to 0 to allow the inode to be freed */
-/* inode->i_nlink = 0; */
-
if (atomic_read(&inode->i_count) == 1)
{
/* kill dentries associated with this inode */
More information about the PVFS2-CVS
mailing list