[sheepdog] [PATCH v4 2/2] sheep: implement atomic create and write mechanism for config

Liu Yuan namei.unix at gmail.com
Wed Apr 17 05:05:26 CEST 2013


On 04/16/2013 05:04 PM, Hitoshi Mitake wrote:
> +	ret = rename(tmp_config_path, config_path);
> +	if (ret < 0) {
> +		sd_eprintf("failed to rename, %m");
> +		ret = SD_RES_EIO;
> +	}
> +
> +	unlink(tmp_config_path);

rename already implies unlink() the old dentry. unlink(tmp_config_path)
isn't necessary.

Thanks,
Yuan



More information about the sheepdog mailing list