Im working on a project, where i'm having two same copies of same files on two remote machines.

i'm tracking the changes in files from vfs_write in read_write.c

i hooked vfs_write and took its all parameters like buf, count, position...

opened _related file structure_ on remote machine and called vfs_write ON REMOTE MACHINE WITH THESE TRANSFERED PARAMETES...

so now, if i APPEND something to one file on machine A, same append is done on machine B!!

e.g.
if on machine A,
a.txt is "abcd"
then

if i do #echo "e" >> a.txt

vfs_write calls are called on both machies (for their file structure of a.txt ) with same parameters (position buffer etc)

its working fine for append..

NOW, i want to keep file on machine B exactly as on machine A at any point of time.. by carrying out all required calls.. WHICH ALL CALLS SHOULD I HOOK?????

PLEASE HELP!!

details of problem faced:

a.txt is "abcdefg"

i call #echo "XYZ" > a.txt NOTE: NO APPENT.. truncate is done..

RESULT :

machine A : a.txt = "XYZ"
machine B : a.txt = "XYZdefg"

please tell me which all other call i should hook and execute remotely ASAP.. thanks