Lines Matching refs:target
36 Result<void> BindMount(const std::string& target, const std::string& source) { in BindMount() argument
37 LOG(VERBOSE) << "Creating bind-mount for " << target << " for " << source; in BindMount()
44 if (stat(target.c_str(), &buf) != 0) { in BindMount()
49 PLOG(ERROR) << "Could not stat target directory " << target; in BindMount()
62 LOG(WARNING) << target << " is not a directory, attempting to fix"; in BindMount()
63 if (unlink(target.c_str()) != 0) { in BindMount()
64 PLOG(ERROR) << "Failed to unlink " << target; in BindMount()
71 LOG(VERBOSE) << "Creating mountpoint " << target; in BindMount()
72 if (mkdir(target.c_str(), kMkdirMode) != 0) { in BindMount()
73 return ErrnoError() << "Could not create mountpoint " << target; in BindMount()
78 int rc = umount2(target.c_str(), UMOUNT_NOFOLLOW); in BindMount()
81 PLOG(ERROR) << "Could not unmount " << target; in BindMount()
86 LOG(VERBOSE) << "Bind-mounting " << source << " to " << target; in BindMount()
87 if (mount(source.c_str(), target.c_str(), nullptr, MS_BIND, nullptr) == 0) { in BindMount()
90 return ErrnoError() << "Could not bind-mount " << source << " to " << target; in BindMount()