Lines Matching defs:index
22 * A file descriptor is the index of a specific channel in this array.
32 /* This function creates a channel from a device index and registers
35 static chan_t *create_new_channel(unsigned char index)
41 if (fdset[i].index == NODEV) {
43 channel->index = index;
57 if ((fd < 0) || (fd >= NR_CHANS) || (fdset[fd].index == NODEV)) {
97 int index;
104 index = 0;
108 if (index == NAMELEN) {
111 token[index++] = *cursor++;
114 token[index] = '\0';
120 * This function returns the driver index in devtab of the driver
125 int index;
128 for (index = 0, dp = devtab; *dp && (*dp)->id != id; ++dp) {
129 index++;
136 return index;
146 channel->index = NODEV;
191 * This function checks whether a channel (identified by its device index and
195 static chan_t *mount_point_to_channel(int index, qid_t qid)
206 if ((channel->index == index) && (channel->qid == qid)) {
219 /* Get the devtab index for the driver identified by id */
220 int index = get_device_index(id);
222 if (index < 0) {
226 return devtab[index]->attach(id, dev);
236 int index;
238 index = get_device_index(id);
239 if (index < 0) {
243 channel = create_new_channel(index);
306 if (devtab[channel->index]->walk(channel, elem) < 0) {
311 mnt = mount_point_to_channel(channel->index, channel->qid);
336 if (c->index == NODEV) {
340 return devtab[c->index]->clone(c, nc);
355 new_channel = create_new_channel(channel->index);
365 new_channel->index = channel->index;
449 dir->index = channel->index;
538 mnt = mount_point_to_channel(dir->index, dir->qid);
541 dir->index = mnt->index;
544 if ((dir->qid != c->qid) || (dir->index != c->index)) {
597 r = devtab[channel->index]->stat(channel, path, dir);
625 return devtab[channel->index]->read(channel, buf, n);
650 return devtab[channel->index]->write(channel, buf, n);
670 return devtab[channel->index]->seek(channel, off, whence);
801 mount_point_chan = devtab[channel->index]->mount(channel, spec);