/** * This is called *after* unlink() or rmdir(), create a whiteout file * if the same file/dir does exist in a lower branch */ int maybe_whiteout(const char *path, int root_rw, enum whiteout mode) { // we are not interested in the branch itself, only if it exists at all if (find_rorw_root(path) != -1) { return do_create_whiteout(path, root_rw, mode); } return 0; }
/** * This is called *after* unlink() or rmdir(), create a whiteout file * if the same file/dir does exist in a lower branch */ int maybe_whiteout(const char *path, int branch_rw, enum whiteout mode) { DBG("%s\n", path); // we are not interested in the branch itself, only if it exists at all if (find_rorw_branch(path) != -1) { int res = do_create_whiteout(path, branch_rw, mode); RETURN(res); } RETURN(0); }
/** * Create a directory that hides path below branch_rw */ int hide_dir(const char *path, int branch_rw) { DBG("%s\n", path); int res = do_create_whiteout(path, branch_rw, WHITEOUT_DIR); RETURN(res); }
/** * Create a directory that hides path below root_rw */ int hide_dir(const char *path, int root_rw) { return do_create_whiteout(path, root_rw, WHITEOUT_DIR); }
/** * Create a file that hides path below root_rw */ int hide_file(const char *path, int root_rw) { return do_create_whiteout(path, root_rw, WHITEOUT_FILE); }