Reputation: 131
Observed that there are vn_xxx apis to perform operation on the file, for example, vn_rdwr(...). From net search, it appears that vn_rdwr(...) is not recommended to be used.
Few queries around the same:
It would be great if someone could provide comments\suggestion?
Upvotes: 2
Views: 819
Reputation: 2349
I believe the vn_rdwr()
is safe and guaranteed to be compatible.
The reason why it is not generally recommended is that it is very low level. By using it you effectively work around any FS file permissions, avoid calling callbacks registered via KAuth API (i.e. spotlight does not see such changes for example) etc. Under most circumstances you should do the I/O in user space (e.g. some daemon).
Go for the I/O in the KExt only if you really have good reason to do so. If you have then use vn_rdwr()
.
Upvotes: 4