I am working on virtual file system in the kernel, my requirement is I want add some more header information to the file when the data is written to the filesystem during this time the control comes to vfs_write() function, in this function I have to add the header information to the file and storing into the filesystem and similarly when the user trying to open the file for reading the system will comes to vfs_read() function , here I have to remove the header and give normal information to user.
Can somebody tell me how I can add the header information.
Are you trying to provide checksum for data? I heard brtfs file system provides data check-sum. Dropping a mail to file system developers is better option.
I want to add some more extra information like I want to encrypt the file and keep the encrypted information in the file header itself.