2 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
33 #include <lib/dmport.h>
36 The variable 'flags' was used with two different meanings within
37 the spec. Sometimes it was an int, and sometimes a u_int. I
38 changed all the u_int references to use the new symbol uflags.
40 The variable 'rlenp' was also used with two different meanings;
41 sometimes size_t, and sometimes dm_size_t. I introduced the new
42 symbol 'dmrlenp' for the dm_size_t cases.
51 dm_sessid_t sid, oldsid, targetsid, *newsidp, *sidbufp;
52 dm_token_t token, *tokenp, *rtokenp, *tokenbufp;
53 dm_attrname_t *attrnamep;
54 dm_off_t off, *offp, *roffp;
56 dm_inherit_t *inheritbufp;
58 dm_size_t len, *dmrlenp, *retvalp;
60 dm_eventset_t *eventsetp;
63 dm_response_t response;
64 dm_right_t right, *rightp;
65 dm_igen_t igen, *igenp;
68 dm_boolean_t enable, *exactflagp;
69 dm_timestruct_t *delay;
71 size_t hlen, dirhlen, hlen1, hlen2, targhlen, *fshlenp, *hlenp;
72 size_t msglen, buflen, *rlenp;
73 u_int nelem, mask, maxmsgs, uflags, *nelemp, maxevent;
74 void *hanp, *dirhanp, *hanp1, *hanp2, *targhanp;
75 void *msgdatap, *bufp, **hanpp, *respbufp, **fshanpp;
76 dm_fsid_t fsid, *fsidp;
78 char *cname, *sessinfop, *path, *pathbufp, **versionstrpp;
79 int flags, fd, setdtime, reterror;
84 /* Definitions per the prototypes in dmport.h, in the same order. */
86 rc = dm_clear_inherit(sid, hanp, hlen, token, attrnamep);
87 rc = dm_create_by_handle(sid, dirhanp, dirhlen, token,
89 rc = dm_create_session(oldsid, sessinfop, newsidp);
90 rc = dm_create_userevent(sid, msglen, msgdatap, tokenp);
91 rc = dm_destroy_session(sid);
92 rc = dm_downgrade_right(sid, hanp, hlen, token);
93 rc = dm_fd_to_handle(fd, hanpp, hlenp);
94 rc = dm_find_eventmsg(sid, token, buflen, bufp, rlenp);
95 rc = dm_get_allocinfo(sid, hanp, hlen,
96 token, offp, nelem, extentp, nelemp);
97 rc = dm_get_bulkall(sid, hanp, hlen, token, mask, attrnamep,
98 locp, buflen, bufp, rlenp);
99 rc = dm_get_bulkattr(sid, hanp, hlen, token, mask, locp, buflen,
101 rc = dm_get_config(hanp, hlen, flagname, retvalp);
102 rc = dm_get_config_events(hanp, hlen, nelem, eventsetp, nelemp);
103 rc = dm_get_dirattrs(sid, hanp, hlen, token, mask, locp, buflen,
105 rc = dm_get_dmattr(sid, hanp, hlen, token, attrnamep, buflen,
107 rc = dm_get_eventlist(sid, hanp, hlen, token, nelem, eventsetp, nelemp);
108 rc = dm_get_events(sid, maxmsgs, flags, buflen, bufp, rlenp);
109 rc = dm_get_fileattr(sid, hanp, hlen, token, mask, statp);
110 rc = dm_get_mountinfo(sid, hanp, hlen, token, buflen, bufp, rlenp);
111 rc = dm_get_region(sid, hanp, hlen, token, nelem, regbufp, nelemp);
112 rc = dm_getall_disp(sid, buflen, bufp, rlenp);
113 rc = dm_getall_dmattr(sid, hanp, hlen, token, buflen, bufp, rlenp);
114 rc = dm_getall_inherit(sid, hanp, hlen,
115 token, nelem, inheritbufp, nelemp);
116 rc = dm_getall_sessions(nelem, sidbufp, nelemp);
117 rc = dm_getall_tokens(sid, nelem, tokenbufp, nelemp);
118 rc = dm_handle_cmp(hanp1, hlen1, hanp2, hlen2);
119 dm_handle_free(hanp, hlen);
120 urc = dm_handle_hash(hanp, hlen);
121 rc = dm_handle_is_valid(hanp, hlen);
122 rc = dm_handle_to_fshandle(hanp, hlen, fshanpp, fshlenp);
123 rc = dm_handle_to_fsid(hanp, hlen, fsidp);
124 rc = dm_handle_to_igen(hanp, hlen, igenp);
125 rc = dm_handle_to_ino(hanp, hlen, inop);
126 rc = dm_handle_to_path(dirhanp, dirhlen, targhanp, targhlen,
127 buflen, pathbufp, rlenp);
128 rc = dm_init_attrloc(sid, hanp, hlen, token, locp);
129 rc = dm_init_service(versionstrpp);
130 rc = dm_make_handle(&fsid, &ino, &igen, hanpp, hlenp);
131 rc = dm_make_fshandle(&fsid, hanpp, hlenp);
132 rc = dm_mkdir_by_handle(sid, dirhanp, dirhlen, token,
134 rc = dm_move_event(sid, token, targetsid, rtokenp);
135 rc = dm_obj_ref_hold(sid, token, hanp, hlen);
136 rc = dm_obj_ref_query(sid, token, hanp, hlen);
137 rc = dm_obj_ref_rele(sid, token, hanp, hlen);
138 rc = dm_path_to_fshandle(path, hanpp, hlenp);
139 rc = dm_path_to_handle(path, hanpp, hlenp);
140 rc = dm_pending(sid, token, delay);
141 rc = dm_probe_hole(sid, hanp, hlen, token, off, len, roffp, dmrlenp);
142 rc = dm_punch_hole(sid, hanp, hlen, token, off, len);
143 rc = dm_query_right(sid, hanp, hlen, token, rightp);
144 rc = dm_query_session(sid, buflen, bufp, rlenp);
145 ssrc = dm_read_invis(sid, hanp, hlen, token, off, len, bufp);
146 rc = dm_release_right(sid, hanp, hlen, token);
147 rc = dm_remove_dmattr(sid, hanp, hlen, token, setdtime, attrnamep);
148 rc = dm_request_right(sid, hanp, hlen, token, uflags, right);
149 rc = dm_respond_event(sid, token, response, reterror, buflen, respbufp);
150 rc = dm_send_msg(sid, msgtype, buflen, bufp);
151 rc = dm_set_disp(sid, hanp, hlen, token, eventsetp, maxevent);
152 rc = dm_set_dmattr(sid, hanp, hlen,
153 token, attrnamep, setdtime, buflen, bufp);
154 rc = dm_set_eventlist(sid, hanp, hlen, token, eventsetp, maxevent);
155 rc = dm_set_fileattr(sid, hanp, hlen, token, mask, attrp);
156 rc = dm_set_inherit(sid, hanp, hlen, token, attrnamep, mode);
157 rc = dm_set_region(sid, hanp, hlen, token, nelem, regbufp, exactflagp);
158 rc = dm_set_return_on_destroy(sid, hanp, hlen,
159 token, attrnamep, enable);
160 rc = dm_symlink_by_handle(sid, dirhanp, dirhlen, token,
161 hanp, hlen, cname, path);
162 rc = dm_sync_by_handle(sid, hanp, hlen, token);
163 rc = dm_upgrade_right(sid, hanp, hlen, token);
164 ssrc = dm_write_invis(sid, hanp, hlen, flags, token, off, len, bufp);