Hi Jim,
> Now I am having a problem with the fs-set-volume-status primitive.
>
> When I call it to change the maxquota (or min qouta) it returns
> ; For future use ( 103)
> ; ( fs-set-volume-status () () () 1818349209 1000 0 () () () )
The problem with fs-set-volume-status is, that it works sometimes, when
the adm server connects to the server on which the volume resides, but
I was never able to find out how it decides which server to connect to.
I finally gave up and wrote a new primitive cachemgr-set-volume-status.
This mimics the the fs setvol command and uses the path name to find
the volume in question, instead of using the volume name.
Hence you would call it as
(cachemgr-set-volume-status "Path" 1000 0 () () () )
in your above example.
I will append the diffs to admext_cachemgr.c at the end of this message.
Hope this helps.
Regards, Dieter.
BTW: it would be interesting what the adm developers have to say about
why fs-set-volume-status does not always find the correct server!
--
Dr. Dieter Mack Phone : +49 711 685 5788
Systems Section Fax : +49 711 682357
Computer Center Email : [EMAIL PROTECTED]
University of Stuttgart Mail : Allmandring 30
70550 Stuttgart-80
Germany
-------------------------------------------------------------------------
*** 85,141 ****
/*****************************************************************************/
- /* Add the 'fs setvol' functionality, i.e. setting the stauts of a */
- /* volume by means of the cache manager D. Mack, RUS, 4/96 */
-
- #define MAXSIZE 1048
-
/* ARGSUSED */
- PROC(admext_cachemgr_SetVolumeStatus)
- {
- char space[MAXSIZE],
- *path,
- *offLineMsg,
- *motd,
- *input;
-
- int follow;
- struct ViceIoctl viceIoctl;
- struct VolumeStatus *status;
-
- viceIoctl.out_size = MAXSIZE;
- viceIoctl.in_size = sizeof(*status) + 3; /* for the three terminating nulls
*/
- viceIoctl.out = space;
- viceIoctl.in = space;
- status = (VolumeStatus *)space;
-
- IF_RTN(admlib_obj_ConvertFromObj
- (inOperands, admlib_obj_ToList,
- admlib_obj_ToString, &path,
- admlib_obj_ToNumberDefault, -1, &status->MinQuota,
- admlib_obj_ToNumberDefault, -1, &status->MaxQuota,
- admlib_obj_ToStringDefault, "", &offLineMsg,
- admlib_obj_ToStringDefault, "", &motd,
- admlib_obj_ToBoolean, &follow,
- ADMLIB_OBJ_END));
- input = (char *)status + sizeof(*status);
- *(input++) = '\0'; /* never set name: this call doesn't change vldb */
- strcpy(input,offLineMsg);
- viceIoctl.in_size += strlen(offLineMsg);
- input += strlen(offLineMsg) + 1;
- strcpy(input,motd);
- viceIoctl.in_size += strlen(motd);
- input += strlen(motd) + 1;
-
- IF_RTN(IOMGR_Poll());
- if (pioctl(path, VIOCSETVOLSTAT, &viceIoctl, follow))
- return errno;
- return OK;
- }
-
- /*****************************************************************************/
-
- /* ARGSUSED */
PROC(admext_cachemgr_SetAcl)
{
char *path;
--- 85,91 ----
***************
*** 366,374 ****
};
setpag();
- IF_RTN(admlib_env_Attach("cachemgr-set-volume-status",
- admext_cachemgr_SetVolumeStatus,
- 0, ADMLIB_EVAL_PRIV));
IF_RTN(admlib_env_Attach("cachemgr-set-acl", admext_cachemgr_SetAcl,
0, ADMLIB_EVAL_PRIV));
IF_RTN(admlib_env_Attach("cachemgr-get-acl", admext_cachemgr_GetAcl,
--- 316,321 ----