1 |
/* |
/* |
2 |
|
|
3 |
Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000 Free Software Foundation |
Copyright (C) 1994,95,96,97,99,2000,02 Free Software Foundation, Inc. |
4 |
|
|
5 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
6 |
modify it under the terms of the GNU General Public License as |
modify it under the terms of the GNU General Public License as |
25 |
#include <assert.h> |
#include <assert.h> |
26 |
|
|
27 |
/* This library supports client-side network file system |
/* This library supports client-side network file system |
28 |
implementations. It is analogous to the diskfs library provided for |
implementations. It is analogous to the diskfs library provided for |
29 |
disk-based filesystems. */ |
disk-based filesystems. */ |
30 |
|
|
31 |
struct argp; |
struct argp; |
33 |
struct protid |
struct protid |
34 |
{ |
{ |
35 |
struct port_info pi; |
struct port_info pi; |
36 |
|
|
37 |
/* User identification */ |
/* User identification */ |
38 |
struct iouser *user; |
struct iouser *user; |
39 |
|
|
40 |
/* Object this refers to */ |
/* Object this refers to */ |
41 |
struct peropen *po; |
struct peropen *po; |
42 |
|
|
43 |
/* Shared memory I/O information. */ |
/* Shared memory I/O information. */ |
44 |
memory_object_t shared_object; |
memory_object_t shared_object; |
45 |
struct shared_io *mapped; |
struct shared_io *mapped; |
68 |
struct node |
struct node |
69 |
{ |
{ |
70 |
struct node *next, **prevp; |
struct node *next, **prevp; |
71 |
|
|
72 |
/* Protocol specific stuff; defined by user. */ |
/* Protocol specific stuff; defined by user. */ |
73 |
struct netnode *nn; |
struct netnode *nn; |
74 |
|
|
75 |
/* The stat information for this particular node. */ |
/* The stat information for this particular node. */ |
76 |
struct stat nn_stat; |
struct stat nn_stat; |
77 |
|
|
78 |
struct mutex lock; |
struct mutex lock; |
79 |
|
|
80 |
/* The number of references to this node. */ |
/* The number of references to this node. */ |
81 |
int references; |
int references; |
82 |
|
|
83 |
mach_port_t sockaddr; |
mach_port_t sockaddr; |
84 |
|
|
85 |
int owner; |
int owner; |
86 |
|
|
87 |
struct transbox transbox; |
struct transbox transbox; |
88 |
|
|
89 |
struct lock_box userlock; |
struct lock_box userlock; |
184 |
name was not found, then return ENOENT. On any error, clear *NP. |
name was not found, then return ENOENT. On any error, clear *NP. |
185 |
(*NP, if found, should be locked and a reference to it generated. |
(*NP, if found, should be locked and a reference to it generated. |
186 |
This call should unlock DIR no matter what.) */ |
This call should unlock DIR no matter what.) */ |
187 |
error_t netfs_attempt_lookup (struct iouser *user, struct node *dir, |
error_t netfs_attempt_lookup (struct iouser *user, struct node *dir, |
188 |
char *name, struct node **np); |
char *name, struct node **np); |
189 |
|
|
190 |
/* The user must define this function. Delete NAME in DIR (which is |
/* The user must define this function. Delete NAME in DIR (which is |
196 |
directory FROMDIR to TODIR. Note that neither of the specific nodes |
directory FROMDIR to TODIR. Note that neither of the specific nodes |
197 |
are locked. */ |
are locked. */ |
198 |
error_t netfs_attempt_rename (struct iouser *user, struct node *fromdir, |
error_t netfs_attempt_rename (struct iouser *user, struct node *fromdir, |
199 |
char *fromname, struct node *todir, |
char *fromname, struct node *todir, |
200 |
char *toname, int excl); |
char *toname, int excl); |
201 |
|
|
202 |
/* The user must define this function. Attempt to create a new |
/* The user must define this function. Attempt to create a new |
207 |
|
|
208 |
/* The user must define this function. Attempt to remove directory |
/* The user must define this function. Attempt to remove directory |
209 |
named NAME in DIR (which is locked) for USER. */ |
named NAME in DIR (which is locked) for USER. */ |
210 |
error_t netfs_attempt_rmdir (struct iouser *user, |
error_t netfs_attempt_rmdir (struct iouser *user, |
211 |
struct node *dir, char *name); |
struct node *dir, char *name); |
212 |
|
|
213 |
|
|
309 |
/* Append to the malloced string *ARGZ of length *ARGZ_LEN a NUL-separated |
/* Append to the malloced string *ARGZ of length *ARGZ_LEN a NUL-separated |
310 |
list of the arguments to this translator. The default definition of this |
list of the arguments to this translator. The default definition of this |
311 |
routine simply calls netfs_append_std_options. */ |
routine simply calls netfs_append_std_options. */ |
312 |
error_t netfs_append_args (char **argz, unsigned *argz_len); |
error_t netfs_append_args (char **argz, size_t *argz_len); |
313 |
|
|
314 |
/* If this is defined or set to a pointer to an argp structure, it will be |
/* If this is defined or set to a pointer to an argp structure, it will be |
315 |
used by the default netfs_set_options to handle runtime option parsing. |
used by the default netfs_set_options to handle runtime option parsing. |