tomoyo_read_lock()/tomoyo_read_unlock() protects the data against the garbagecollector. I call tomoyo_read_lock() when /sys/kernel/security/tomoyo/interface is open()ed and call tomoyo_read_unlock() when/sys/kernel/security/tomoyo/ interface is close()d rather than callingtomoyo_read_lock()/tomoyo_read_unlock() upon individual read()/write()requests. In this way, the pointers saved in "struct tomoyo_io_buffer" areguaranteed to be valid. Please ignore

The "struct tomoyo_profile *"->name is not subjected to GC. It is manuallygarbage collected. Thus, to protect it against tomoyo_read_profile(),tomoyo_write_profile() uses tomoyo_profile_comment_lock spinlock.