[BACK]Return to dmapi_attr.c CVS log [TXT][DIR] Up to [Development] / dmapi

File: [Development] / dmapi / dmapi_attr.c (download)

Revision 1.1, Thu Jul 27 20:19:16 2000 UTC (17 years, 3 months ago) by roehrich
Branch: MAIN

dmapi core.  this compiles and links.

/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1994, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright law.  They  may  not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 **************************************************************************/
#ident "$Revision: 1.6 $"

#include "dmapi_private.h"


/* Retrieve attributes for a single file, directory or symlink. */

int
dm_get_fileattr(
	dm_sessid_t	sid,
	void		*hanp,
	size_t		hlen,
	dm_token_t	token,
	u_int		mask,
	dm_stat_t	*statp)
{
	dm_fsys_vector_t *fsys_vector;
	dm_tokdata_t	*tdp;
	int 		error;

	printk("*** this is %s: %s/%d\n", __FUNCTION__, __FILE__, __LINE__);

	error = dm_app_get_tdp(sid, hanp, hlen, token, DM_TDT_VNO,
		DM_RIGHT_SHARED, &tdp);
	if (error != 0)
		return(error);

	fsys_vector = dm_fsys_vector(tdp->td_bdp);
	error = fsys_vector->get_fileattr(tdp->td_bdp, tdp->td_right,
		mask, statp);

	dm_app_put_tdp(tdp);
	return(error);
}


/* Set one or more file attributes of a file, directory, or symlink. */

int
dm_set_fileattr(
	dm_sessid_t	sid,
	void		*hanp,
	size_t		hlen,
	dm_token_t	token,
	u_int		mask,
	dm_fileattr_t	*attrp)
{
	dm_fsys_vector_t *fsys_vector;
	dm_tokdata_t	*tdp;
	int 		error;

	printk("*** this is %s: %s/%d\n", __FUNCTION__, __FILE__, __LINE__);

	error = dm_app_get_tdp(sid, hanp, hlen, token, DM_TDT_VNO,
		DM_RIGHT_EXCL, &tdp);
	if (error != 0)
		return(error);

	fsys_vector = dm_fsys_vector(tdp->td_bdp);
	error = fsys_vector->set_fileattr(tdp->td_bdp, tdp->td_right,
		mask, attrp);

	dm_app_put_tdp(tdp);
	return(error);
}