[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/kernel/linux-2.6:
inode.c pvfs2-kernel.h pvfs2-utils.c
CVS commit program
cvs at parl.clemson.edu
Fri Aug 8 11:06:13 EDT 2008
Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv29170/src/kernel/linux-2.6
Modified Files:
inode.c pvfs2-kernel.h pvfs2-utils.c
Log Message:
Added new blksize field to system attributes returned by PVFS_sys_getattr().
Modified kernel stat function to return this value as the st_blksize field
in the stat() system call. blksize is distribution specific and normally
indicates the strip size for the file.
Index: inode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/inode.c,v
diff -p -u -r1.85 -r1.86
--- inode.c 10 Jun 2008 15:00:32 -0000 1.85
+++ inode.c 8 Aug 2008 15:06:13 -0000 1.86
@@ -243,6 +243,7 @@ int pvfs2_getattr(
{
int ret = -ENOENT;
struct inode *inode = dentry->d_inode;
+ pvfs2_inode_t *pvfs2_inode = NULL;
gossip_debug(GOSSIP_INODE_DEBUG,
"pvfs2_getattr: called on %s\n", dentry->d_name.name);
@@ -273,6 +274,9 @@ int pvfs2_getattr(
if (ret == 0)
{
generic_fillattr(inode, kstat);
+ /* override block size reported to stat */
+ pvfs2_inode = PVFS2_I(inode);
+ kstat->blksize = pvfs2_inode->blksize;
}
else
{
Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -p -u -r1.153 -r1.154
--- pvfs2-kernel.h 10 Jun 2008 13:38:01 -0000 1.153
+++ pvfs2-kernel.h 8 Aug 2008 15:06:13 -0000 1.154
@@ -371,6 +371,7 @@ typedef struct
{
PVFS_object_ref refn;
char link_target[PVFS_NAME_MAX];
+ PVFS_size blksize;
/*
* Reading/Writing Extended attributes need to acquire the appropriate
* reader/writer semaphore on the pvfs2_inode_t structure.
Index: pvfs2-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-utils.c,v
diff -p -u -r1.152 -r1.153
--- pvfs2-utils.c 19 May 2008 17:51:20 -0000 1.152
+++ pvfs2-utils.c 8 Aug 2008 15:06:13 -0000 1.153
@@ -503,6 +503,22 @@ int pvfs2_inode_getattr(struct inode *in
ret = -ENOENT;
goto copy_attr_failure;
}
+
+ /* store blksize in pvfs2 specific part of inode structure; we
+ * are only going to use this to report to stat to make sure it
+ * doesn't perturb any inode related code paths
+ */
+ if(new_op->downcall.resp.getattr.attributes.objtype
+ == PVFS_TYPE_METAFILE)
+ {
+ pvfs2_inode->blksize =
+ new_op->downcall.resp.getattr.attributes.blksize;
+ }
+ else
+ {
+ /* mimic behavior of generic_fillattr() for other types */
+ pvfs2_inode->blksize = (1 << inode->i_blkbits);
+ }
}
copy_attr_failure:
More information about the Pvfs2-cvs
mailing list