Lines Matching refs:file

4  * The contents of this file are subject to the terms of the
6 * You may not use this file except in compliance with the License.
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
59 struct nfs_file file;
91 * we only permit one open file at a time (not counting the device), this
106 if (nfs_files->file.version == 0 &&
117 /* clear the first, static file */
127 * Get a file pointer given a file descriptor. Return 0 on error
152 * open a file for reading. Note: writing is NOT supported.
166 /* file can only be opened readonly. */
177 /* Try and find a vacant file pointer */
184 break; /* We've got a file pointer */
191 /* If a a vacant file pointer cannot be found, make one */
195 dprintf("open: Cannot allocate file pointer\n");
203 if (lookup(path, &filep->file, FALSE) != 0) {
208 /* zero file pointer */
213 bzero(&filep->file.cookie, sizeof (filep->file.cookie));
224 * close a previously opened file.
239 * zero file pointer
241 bzero((caddr_t)&filep->file, sizeof (struct nfs_file));
252 * read from a file.
261 dprintf("boot_nfs_read: Bad file number.\n");
278 switch (filep->file.version) {
280 count = nfsread(&filep->file, buf, size);
283 count = nfs3read(&filep->file, buf, size);
286 count = nfs4read(&filep->file, buf, size);
290 filep->file.version);
303 * lseek - move read file pointer.
317 dprintf("boot_nfs_lseek: Bad file number.\n");
328 * file ptr is set to offset from beginning of file
330 filep->file.offset = offset;
334 * file ptr is set to offset from current position
336 filep->file.offset += offset;
340 * file ptr is set to current size of file plus offset.
352 return (filep->file.offset);
381 dprintf("boot_nfs_fstat(): Bad file number 0.\n");
392 switch (filep->file.version) {
394 status = nfsgetattr(&filep->file, &va);
397 status = nfs3getattr(&filep->file, &va);
400 status = nfs4getattr(&filep->file, &va);
404 filep->file.version);
446 dprintf("boot_nfs_getdents(): Bad file number 0.\n");
453 switch (filep->file.version) {
455 status = nfsgetdents(&filep->file, dep, size);
458 status = nfs3getdents(&filep->file, dep, size);
462 filep->file.version);