Lines Matching refs:fd

123 	int fd;  member
138 int fd; member
156 .fd = -1, \
165 .fd = -1, \
500 int fd; in ubd_file_size() local
517 fd = os_open_file(ubd_dev->file, of_read(OPENFLAGS()), 0); in ubd_file_size()
518 if (fd < 0) in ubd_file_size()
519 return fd; in ubd_file_size()
521 err = read_cow_header(file_reader, &fd, &version, &backing_file, \ in ubd_file_size()
523 os_close_file(fd); in ubd_file_size()
534 static int read_cow_bitmap(int fd, void *buf, int offset, int len) in read_cow_bitmap() argument
538 err = os_seek_file(fd, offset); in read_cow_bitmap()
542 err = os_read_file(fd, buf, len); in read_cow_bitmap()
624 int fd, err, sectorsize, asked_switch, mode = 0644; in open_ubd_file() local
626 fd = os_open_file(file, *openflags, mode); in open_ubd_file()
627 if (fd < 0) { in open_ubd_file()
628 if ((fd == -ENOENT) && (create_cow_out != NULL)) in open_ubd_file()
631 ((fd != -EROFS) && (fd != -EACCES))) in open_ubd_file()
632 return fd; in open_ubd_file()
634 fd = os_open_file(file, *openflags, mode); in open_ubd_file()
635 if (fd < 0) in open_ubd_file()
636 return fd; in open_ubd_file()
642 err = os_lock_file(fd, openflags->w); in open_ubd_file()
652 return fd; in open_ubd_file()
654 err = read_cow_header(file_reader, &fd, &version, &backing_file, &mtime, in open_ubd_file()
662 return fd; in open_ubd_file()
672 err = write_cow_header(file, fd, *backing_file_out, in open_ubd_file()
688 return fd; in open_ubd_file()
690 os_close_file(fd); in open_ubd_file()
699 int err, fd; in create_cow_file() local
702 fd = open_ubd_file(cow_file, &flags, 0, NULL, NULL, NULL, NULL, NULL); in create_cow_file()
703 if (fd < 0) { in create_cow_file()
704 err = fd; in create_cow_file()
710 err = init_cow_file(fd, cow_file, backing_file, sectorsize, alignment, in create_cow_file()
714 return fd; in create_cow_file()
715 os_close_file(fd); in create_cow_file()
722 os_close_file(ubd_dev->fd); in ubd_close_dev()
726 os_close_file(ubd_dev->cow.fd); in ubd_close_dev()
736 int fd; in ubd_open_dev() local
743 fd = open_ubd_file(ubd_dev->file, &ubd_dev->openflags, ubd_dev->shared, in ubd_open_dev()
748 if((fd == -ENOENT) && create_cow){ in ubd_open_dev()
749 fd = create_cow_file(ubd_dev->file, ubd_dev->cow.file, in ubd_open_dev()
754 if(fd >= 0){ in ubd_open_dev()
760 if(fd < 0){ in ubd_open_dev()
762 -fd); in ubd_open_dev()
763 return fd; in ubd_open_dev()
765 ubd_dev->fd = fd; in ubd_open_dev()
778 err = read_cow_bitmap(ubd_dev->fd, ubd_dev->cow.bitmap, in ubd_open_dev()
789 ubd_dev->cow.fd = err; in ubd_open_dev()
793 os_close_file(ubd_dev->fd); in ubd_open_dev()
1221 io_req->fds[0] = (ubd_dev->cow.file != NULL) ? ubd_dev->cow.fd : in prepare_request()
1222 ubd_dev->fd; in prepare_request()
1223 io_req->fds[1] = ubd_dev->fd; in prepare_request()
1250 io_req->fds[0] = (ubd_dev->cow.file != NULL) ? ubd_dev->cow.fd : in prepare_flush_request()
1251 ubd_dev->fd; in prepare_flush_request()