Lines Matching refs:f

91 	struct open_file *f;  in fd2open_file()  local
93 TAILQ_FOREACH(f, &files, f_link) { in fd2open_file()
95 if (f->f_id == fd) in fd2open_file()
100 if (f->f_flags == 0) in fd2open_file()
103 return (f); in fd2open_file()
109 struct open_file *f, *last; in o_gethandle() local
112 f = fd2open_file(-1); in o_gethandle()
113 if (f != NULL) { in o_gethandle()
114 *ptr = f; in o_gethandle()
115 return (f->f_id); in o_gethandle()
119 f = calloc(1, sizeof (*f)); in o_gethandle()
120 if (f == NULL) in o_gethandle()
125 f->f_id = last->f_id + 1; in o_gethandle()
126 TAILQ_INSERT_TAIL(&files, f, f_link); in o_gethandle()
128 *ptr = f; in o_gethandle()
129 return (f->f_id); in o_gethandle()
133 o_rainit(struct open_file *f) in o_rainit() argument
135 f->f_rabuf = malloc(SOPEN_RASIZE); in o_rainit()
136 f->f_ralen = 0; in o_rainit()
137 f->f_raoffset = 0; in o_rainit()
144 struct open_file *f; in open() local
150 if ((fd = o_gethandle(&f)) == -1) { in open()
155 f->f_flags = mode + 1; in open()
156 f->f_dev = NULL; in open()
157 f->f_ops = NULL; in open()
158 f->f_offset = 0; in open()
159 f->f_devdata = NULL; in open()
164 error = (fs->fo_open)(fname, f); in open()
170 error = devopen(f, fname, &file); in open()
172 (((f->f_flags & F_NODEV) == 0) && f->f_dev == NULL)) in open()
177 f->f_flags |= F_RAW; in open()
178 f->f_rabuf = NULL; in open()
187 error = (fs->fo_open)(file, f); in open()
195 if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) in open()
196 f->f_dev->dv_close(f); in open()
198 devclose(f); in open()
201 f->f_flags = 0; in open()
207 f->f_ops = fs; in open()
208 o_rainit(f); in open()