Lines Matching full:if

76         if (*c) {  in local_open_nofollow()
87 if (fd != data->mountfd) { in local_open_nofollow()
128 if (mode[0] == 'r') { in local_fopenat()
130 } else if (mode[0] == 'w') { in local_fopenat()
137 if (fd == -1) { in local_fopenat()
141 if (!fp) { in local_fopenat()
155 if (strcmp(name, ".")) { in local_mapped_file_attr()
157 if (map_dirfd == -1) { in local_mapped_file_attr()
166 if (!fp) { in local_mapped_file_attr()
171 if (!strncmp(buf, "virtfs.uid", 10)) { in local_mapped_file_attr()
173 } else if (!strncmp(buf, "virtfs.gid", 10)) { in local_mapped_file_attr()
175 } else if (!strncmp(buf, "virtfs.mode", 11)) { in local_mapped_file_attr()
177 } else if (!strncmp(buf, "virtfs.rdev", 11)) { in local_mapped_file_attr()
193 if (dirfd == -1) { in local_lstat()
198 if (err) { in local_lstat()
201 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_lstat()
208 if (fgetxattrat_nofollow(dirfd, name, "user.virtfs.uid", &tmp_uid, in local_lstat()
212 if (fgetxattrat_nofollow(dirfd, name, "user.virtfs.gid", &tmp_gid, in local_lstat()
216 if (fgetxattrat_nofollow(dirfd, name, "user.virtfs.mode", &tmp_mode, in local_lstat()
220 if (fgetxattrat_nofollow(dirfd, name, "user.virtfs.rdev", &tmp_dev, in local_lstat()
224 } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_lstat()
246 if (is_root) { in local_set_mapped_file_attrat()
248 if (!fp) { in local_set_mapped_file_attrat()
249 if (errno == ENOENT) { in local_set_mapped_file_attrat()
257 if (ret < 0 && errno != EEXIST) { in local_set_mapped_file_attrat()
262 if (map_dirfd == -1) { in local_set_mapped_file_attrat()
267 if (!fp) { in local_set_mapped_file_attrat()
268 if (errno == ENOENT) { in local_set_mapped_file_attrat()
278 if (!strncmp(buf, "virtfs.uid", 10)) { in local_set_mapped_file_attrat()
280 } else if (!strncmp(buf, "virtfs.gid", 10)) { in local_set_mapped_file_attrat()
282 } else if (!strncmp(buf, "virtfs.mode", 11)) { in local_set_mapped_file_attrat()
284 } else if (!strncmp(buf, "virtfs.rdev", 11)) { in local_set_mapped_file_attrat()
292 if (is_root) { in local_set_mapped_file_attrat()
299 if (map_dirfd != -1) { in local_set_mapped_file_attrat()
303 if (!fp) { in local_set_mapped_file_attrat()
312 if (credp->fc_uid != -1) { in local_set_mapped_file_attrat()
315 if (credp->fc_gid != -1) { in local_set_mapped_file_attrat()
318 if (credp->fc_mode != (mode_t)-1) { in local_set_mapped_file_attrat()
321 if (credp->fc_rdev != -1) { in local_set_mapped_file_attrat()
325 if (uid != -1) { in local_set_mapped_file_attrat()
328 if (gid != -1) { in local_set_mapped_file_attrat()
331 if (mode != -1) { in local_set_mapped_file_attrat()
334 if (rdev != -1) { in local_set_mapped_file_attrat()
352 if (qemu_fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW)) { in fchmodat_nofollow()
355 if (S_ISLNK(stbuf.st_mode)) { in fchmodat_nofollow()
361 #if O_PATH_9P_UTIL == 0 in fchmodat_nofollow()
365 if (fd == -1) { in fchmodat_nofollow()
367 if (errno == EACCES) { in fchmodat_nofollow()
370 if (fd == -1 && errno == EISDIR) { in fchmodat_nofollow()
374 if (fd == -1) { in fchmodat_nofollow()
379 /* Access modes are ignored when O_PATH is supported. If name is a symbolic in fchmodat_nofollow()
383 if (fd == -1) { in fchmodat_nofollow()
389 if (!ret) { in fchmodat_nofollow()
390 if (S_ISLNK(stbuf.st_mode)) { in fchmodat_nofollow()
408 if (credp->fc_uid != -1) { in local_set_xattrat()
412 if (err) { in local_set_xattrat()
416 if (credp->fc_gid != -1) { in local_set_xattrat()
420 if (err) { in local_set_xattrat()
424 if (credp->fc_mode != (mode_t)-1) { in local_set_xattrat()
428 if (err) { in local_set_xattrat()
432 if (credp->fc_rdev != -1) { in local_set_xattrat()
436 if (err) { in local_set_xattrat()
446 if (fchownat(dirfd, name, credp->fc_uid, credp->fc_gid, in local_set_cred_passthrough()
449 * If we fail to change ownership and if we are in local_set_cred_passthrough()
452 if ((fs_ctx->export_flags & V9FS_SEC_MASK) != V9FS_SM_NONE) { in local_set_cred_passthrough()
465 if ((fs_ctx->export_flags & V9FS_SM_MAPPED) || in local_readlink()
470 if (fd == -1) { in local_readlink()
475 } else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) || in local_readlink()
482 if (dirfd == -1) { in local_readlink()
511 if (fd == -1) { in local_open()
525 if (dirfd == -1) { in local_opendir()
530 if (!stream) { in local_opendir()
560 if (!entry) { in local_readdir()
566 /* If telldir fails, fail the entire readdir call */ in local_readdir()
567 if (off < 0) { in local_readdir()
573 if (ctx->export_flags & V9FS_SM_MAPPED) { in local_readdir()
575 } else if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_readdir()
576 if (local_is_mapped_file_metadata(ctx, entry->d_name)) { in local_readdir()
599 if (err == -1) { in local_preadv()
616 if (err == -1) { in local_pwritev()
623 if (ret > 0 && ctx->export_flags & V9FS_IMMEDIATE_WRITEOUT) { in local_pwritev()
644 if (dirfd == -1) { in local_chmod()
648 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_chmod()
650 } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_chmod()
652 } else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH || in local_chmod()
670 if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_mknod()
677 if (dirfd == -1) { in local_mknod()
681 if (fs_ctx->export_flags & V9FS_SM_MAPPED || in local_mknod()
684 if (err == -1) { in local_mknod()
688 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_mknod()
693 if (err == -1) { in local_mknod()
696 } else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH || in local_mknod()
699 if (err == -1) { in local_mknod()
703 if (err == -1) { in local_mknod()
722 if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_mkdir()
729 if (dirfd == -1) { in local_mkdir()
733 if (fs_ctx->export_flags & V9FS_SM_MAPPED || in local_mkdir()
736 if (err == -1) { in local_mkdir()
741 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_mkdir()
746 if (err == -1) { in local_mkdir()
749 } else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH || in local_mkdir()
752 if (err == -1) { in local_mkdir()
756 if (err == -1) { in local_mkdir()
771 if (fid_type == P9_FID_DIR) { in local_fid_fd()
784 if (err) { in local_fstat()
787 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_fstat()
794 if (qemu_fgetxattr(fd, "user.virtfs.uid", in local_fstat()
798 if (qemu_fgetxattr(fd, "user.virtfs.gid", in local_fstat()
802 if (qemu_fgetxattr(fd, "user.virtfs.mode", in local_fstat()
806 if (qemu_fgetxattr(fd, "user.virtfs.rdev", in local_fstat()
810 } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_fstat()
824 if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_open2()
836 if (dirfd == -1) { in local_open2()
841 if (fs_ctx->export_flags & V9FS_SM_MAPPED || in local_open2()
844 if (fd == -1) { in local_open2()
848 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_open2()
854 if (err == -1) { in local_open2()
857 } else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) || in local_open2()
860 if (fd == -1) { in local_open2()
864 if (err == -1) { in local_open2()
888 if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_symlink()
895 if (dirfd == -1) { in local_symlink()
900 if (fs_ctx->export_flags & V9FS_SM_MAPPED || in local_symlink()
907 if (fd == -1) { in local_symlink()
915 if (write_size != oldpath_size) { in local_symlink()
921 if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_symlink()
926 if (err == -1) { in local_symlink()
929 } else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH || in local_symlink()
932 if (err) { in local_symlink()
937 if (err == -1) { in local_symlink()
939 * If we fail to change ownership and if we are in local_symlink()
942 if ((fs_ctx->export_flags & V9FS_SEC_MASK) != V9FS_SM_NONE) { in local_symlink()
966 if (ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_link()
973 if (odirfd == -1) { in local_link()
978 if (ndirfd == -1) { in local_link()
984 if (ret < 0) { in local_link()
989 if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_link()
993 if (ret < 0 && errno != EEXIST) { in local_link()
998 if (omap_dirfd == -1) { in local_link()
1003 if (nmap_dirfd == -1) { in local_link()
1011 if (ret < 0 && errno != ENOENT) { in local_link()
1037 if (fd == -1) { in local_truncate()
1061 if (dirfd == -1) { in local_chown()
1065 if ((credp->fc_uid == -1 && credp->fc_gid == -1) || in local_chown()
1070 } else if (fs_ctx->export_flags & V9FS_SM_MAPPED) { in local_chown()
1072 } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_chown()
1091 if (dirfd == -1) { in local_utimensat()
1116 if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_unlinkat_common()
1120 * - the metadata directory if we're removing a directory in local_unlinkat_common()
1123 * If any of these are missing (ie, ENOENT) then we're probably in local_unlinkat_common()
1127 if (flags == AT_REMOVEDIR) { in local_unlinkat_common()
1131 if (fd == -1) { in local_unlinkat_common()
1136 if (ret < 0 && errno != ENOENT) { in local_unlinkat_common()
1141 if (map_dirfd != -1) { in local_unlinkat_common()
1144 if (ret < 0 && errno != ENOENT) { in local_unlinkat_common()
1147 } else if (errno != ENOENT) { in local_unlinkat_common()
1165 if (dirfd == -1) { in local_remove()
1169 if (qemu_fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { in local_remove()
1173 if (S_ISDIR(stbuf.st_mode)) { in local_remove()
1191 if (datasync) { in local_fsync()
1203 if (fd == -1) { in local_statfs()
1246 if (ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_name_to_path()
1252 if (dir_path) { in local_name_to_path()
1253 if (!strcmp(name, ".")) { in local_name_to_path()
1256 } else if (!strcmp(name, "..")) { in local_name_to_path()
1257 if (!strcmp(dir_path->data, ".")) { in local_name_to_path()
1272 } else if (!strcmp(name, "/") || !strcmp(name, ".") || in local_name_to_path()
1290 if (ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_renameat()
1298 if (odirfd == -1) { in local_renameat()
1303 if (ndirfd == -1) { in local_renameat()
1309 if (ret < 0) { in local_renameat()
1313 if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_renameat()
1317 if (ret < 0 && errno != EEXIST) { in local_renameat()
1322 if (omap_dirfd == -1) { in local_renameat()
1327 if (nmap_dirfd == -1) { in local_renameat()
1336 if (ret < 0 && errno != ENOENT) { in local_renameat()
1387 if (ctx->export_flags & V9FS_SM_MAPPED_FILE && in local_unlinkat()
1394 if (dirfd == -1) { in local_unlinkat()
1414 if (!S_ISREG(st_mode) && !S_ISDIR(st_mode)) { in local_ioc_getversion()
1419 if (err < 0) { in local_ioc_getversion()
1434 * use ioc_getversion only if the ioctl is defined in local_ioc_getversion_init()
1436 if (fstatfs(data->mountfd, &stbuf) < 0) { in local_ioc_getversion_init()
1458 if (data->mountfd == -1) { in local_init()
1463 if (local_ioc_getversion_init(ctx, data, errp) < 0) { in local_init()
1468 if (ctx->export_flags & V9FS_SM_PASSTHROUGH) { in local_init()
1470 } else if (ctx->export_flags & V9FS_SM_MAPPED) { in local_init()
1472 } else if (ctx->export_flags & V9FS_SM_NONE) { in local_init()
1474 } else if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { in local_init()
1495 if (!data) { in local_cleanup()
1516 if (!sec_model) { in local_parse_opts()
1522 if (!strcmp(sec_model, "passthrough")) { in local_parse_opts()
1524 } else if (!strcmp(sec_model, "mapped") || in local_parse_opts()
1527 } else if (!strcmp(sec_model, "none")) { in local_parse_opts()
1529 } else if (!strcmp(sec_model, "mapped-file")) { in local_parse_opts()
1537 if (multidevs) { in local_parse_opts()
1538 if (!strcmp(multidevs, "remap")) { in local_parse_opts()
1541 } else if (!strcmp(multidevs, "forbid")) { in local_parse_opts()
1544 } else if (!strcmp(multidevs, "warn")) { in local_parse_opts()
1559 if (!path) { in local_parse_opts()
1564 if (fsdev_throttle_parse_opts(opts, &fse->fst, errp)) { in local_parse_opts()
1569 if (fse->export_flags & V9FS_SM_MAPPED || in local_parse_opts()
1576 if (qemu_opt_find(opts, "fmode")) { in local_parse_opts()
1580 if (qemu_opt_find(opts, "dmode")) { in local_parse_opts()