So, the term for what I was asking about is apparently XA for "eXtended Architecture," where a transaction might span multiple data sources.
According to the Wikipedia article, the XA standard, which many data stores implement, uses 2-phase commit. I think this is mainly only implemented by databases, and appears to be in Oracle/SQLServer/DB2/PostgreSQL, possibly others. Filesystems don't seem to expose this primitive to user-level applications, although maybe some of them do.
You could also use a different consensus protocol (3-phase commit/Paxos being the most common) but in practice few systems give access to that so 2-phase commit is your best bet.