Lines Matching defs:fs
69 fserver *fs = localhost;
71 if (!fs) {
72 fs = ALLOC(struct fserver);
73 fs->fs_refc = 0;
74 fs->fs_host = strdup("localhost");
75 fs->fs_ip = NULL;
76 fs->fs_cid = 0;
77 fs->fs_pinger = AM_PINGER;
78 fs->fs_flags = FSF_VALID | FSF_PING_UNINIT;
79 fs->fs_type = "local";
80 fs->fs_private = NULL;
81 fs->fs_prfree = NULL;
83 ins_que(&fs->fs_q, &amfs_auto_srvr_list);
85 srvrlog(fs, "starts up");
87 localhost = fs;
89 fs->fs_refc++;
91 return fs;
103 wakeup_srvr(fserver *fs)
105 fs->fs_flags &= ~FSF_WANT;
106 wakeup((voidp) fs);
116 fserver *fs = v;
122 if (fs->fs_refc == 0) {
123 dlog("Deleting file server %s", fs->fs_host);
124 if (fs->fs_flags & FSF_WANT)
125 wakeup_srvr(fs);
130 rem_que(&fs->fs_q);
134 if (fs->fs_private && fs->fs_prfree)
135 (*fs->fs_prfree) (fs->fs_private);
140 if (fs->fs_ip)
141 XFREE(fs->fs_ip);
146 XFREE(fs->fs_host);
151 XFREE(fs);
160 free_srvr(fserver *fs)
162 if (--fs->fs_refc == 0) {
169 int ttl = (FSRV_ERROR(fs) || FSRV_ISDOWN(fs)) ? 19 : AM_TTL;
171 dlog("Last hard reference to file server %s - will timeout in %ds", fs->fs_host, ttl);
172 if (fs->fs_cid) {
173 untimeout(fs->fs_cid);
177 fs->fs_flags &= ~FSF_PINGING;
183 fs->fs_cid = timeout(ttl, timeout_srvr, (voidp) fs);
188 fs->fs_flags &= ~FSF_VALID;
189 fs->fs_flags |= FSF_DOWN;
198 dup_srvr(fserver *fs)
200 fs->fs_refc++;
201 return fs;
209 srvrlog(fserver *fs, char *state)
211 plog(XLOG_INFO, "file server %s, type %s, state %s", fs->fs_host, fs->fs_type, state);