For your question, yes I think we could add sqe->update_flags (something
like that) and union it with the other flags, and add a flag that means
we're updating buffers instead of files. A bit iffy with the naming of
the opcode itself, but probably still a useful way to go.
#define OPCODE_UPDATE_RESOURCES OPCODE_UPDATE_FILES
With define + documenting that they're same IMHO should be fine.
I tried to use a single opcode for files/buffers but ran into an
issue since work_flags is different for files/buffers. This should
be ok for the most part since req->work.flags is ultimately examined;
however, there are place where io_op_defs[opcode].work_flags is examined
directly, and I wasn't sure what would the best way to handle that.