[Pvfs2-cvs] commit by kunkel in pvfs2/src/client/sysint:
sys-getattr.sm sys-create.sm sys-truncate.sm sys-io.sm
CVS commit program
cvs at parl.clemson.edu
Sat Dec 2 06:20:32 EST 2006
Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb1:/tmp/cvs-serv18213/src/client/sysint
Modified Files:
Tag: kunkel-hint-branch
sys-getattr.sm sys-create.sm sys-truncate.sm sys-io.sm
Log Message:
Upgrade to current CVS version
Index: sys-getattr.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-getattr.sm,v
diff -p -u -r1.101.2.2 -r1.101.2.3
--- sys-getattr.sm 25 Sep 2006 12:39:50 -0000 1.101.2.2
+++ sys-getattr.sm 2 Dec 2006 11:20:31 -0000 1.101.2.3
@@ -851,11 +851,15 @@ static int getattr_set_sys_response(PINT
}
}
- /* special case for when users ask for dfile count */
- if(attr->objtype == PVFS_TYPE_METAFILE &&
- sm_p->getattr.req_attrmask & PVFS_ATTR_META_DFILES)
+ if(attr->objtype == PVFS_TYPE_METAFILE)
{
- sysresp->attr.dfile_count = attr->u.meta.dfile_count;
+ /* Copy if there are any special object specific flags */
+ sysresp->attr.flags = attr->u.meta.hint.flags;
+ /* special case for when users ask for dfile count */
+ if (sm_p->getattr.req_attrmask & PVFS_ATTR_META_DFILES)
+ {
+ sysresp->attr.dfile_count = attr->u.meta.dfile_count;
+ }
}
if (attr->objtype == PVFS_TYPE_DIRECTORY)
{
@@ -907,7 +911,6 @@ static int getattr_set_sys_response(PINT
if (js_p->error_code == 0)
{
-
/* convert outgoing attribute mask based on what we got */
sysresp->attr.mask = PVFS_util_object_to_sys_attr_mask(
sm_p->getattr.attr.mask);
Index: sys-create.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-create.sm,v
diff -p -u -r1.96.2.3 -r1.96.2.4
--- sys-create.sm 25 Sep 2006 15:28:40 -0000 1.96.2.3
+++ sys-create.sm 2 Dec 2006 11:20:31 -0000 1.96.2.4
@@ -248,11 +248,11 @@ PVFS_error PVFS_isys_create(
return ret;
}
- if ((attr.mask & PVFS_ATTR_SYS_ALL_SETABLE) !=
- PVFS_ATTR_SYS_ALL_SETABLE)
+ if ((attr.mask & PVFS_ATTR_SYS_ALL_SETABLE) != PVFS_ATTR_SYS_ALL_SETABLE)
{
- gossip_lerr("PVFS_isys_create() failure: invalid attributes "
- "specified\n");
+ gossip_lerr("PVFS_isys_create() failure: invalid attribute mask: %d, "
+ "expected SYS_ALL_SETABLE (%d)\n",
+ attr.mask, PVFS_ATTR_SYS_ALL_SETABLE);
return ret;
}
Index: sys-truncate.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-truncate.sm,v
diff -p -u -r1.50.2.2 -r1.50.2.3
--- sys-truncate.sm 25 Sep 2006 12:39:51 -0000 1.50.2.2
+++ sys-truncate.sm 2 Dec 2006 11:20:31 -0000 1.50.2.3
@@ -187,6 +187,13 @@ static int truncate_datafile_setup_msgpa
assert(attr->mask & PVFS_ATTR_META_DIST);
assert(attr->u.meta.dfile_count > 0);
assert(attr->u.meta.dist_size > 0);
+ /* cannot truncate an append-only or immutable file */
+ if ((attr->u.meta.hint.flags & PVFS_IMMUTABLE_FL)
+ || (attr->u.meta.hint.flags & PVFS_APPEND_FL))
+ {
+ js_p->error_code = -PVFS_EPERM;
+ return 1;
+ }
sm_p->msgarray_count = attr->u.meta.dfile_count;
Index: sys-io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-io.sm,v
diff -p -u -r1.150.2.3 -r1.150.2.4
--- sys-io.sm 25 Sep 2006 15:28:40 -0000 1.150.2.3
+++ sys-io.sm 2 Dec 2006 11:20:31 -0000 1.150.2.4
@@ -452,7 +452,13 @@ static int io_datafile_setup_msgpairs(PI
js_p->error_code = -PVFS_EBADF;
goto exit;
}
-
+ /* cannot write to an immutable file */
+ if (sm_p->u.io.io_type == PVFS_IO_WRITE
+ && (attr->u.meta.hint.flags & PVFS_IMMUTABLE_FL))
+ {
+ js_p->error_code = -PVFS_EPERM;
+ goto exit;
+ }
ret = PINT_dist_lookup(attr->u.meta.dist);
if (ret)
{
More information about the Pvfs2-cvs
mailing list