VFS concurrency control and initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm starting to hack on VFS, my first kernel hacking project, and have
a couple of preliminary questions.

First, I'm trying to modify 'sys_open' from fs/open.c, representing
the 'open' system call.  I'd like to make an update to a global data
structure on every open system call.  Updates to this data structure
will need to be mutually exclusive in order to avoid data structure
corruption.  Do I need to initiate some form of concurrency control,
or does 'sys_open' already happen atomically?

Secondly, I'm not exactly sure where to declare and initialize the
global data structure I'm referring to in the above paragraph.  I
expect it should be initialized when VFS is initialized.  Where should
I look for VFS init?  I'm noticing that the buffer cache is
initialized in 'buffer_init' from fs/buffer.c, but am looking for a
general place to initialize my global data structure.

Thanks,
-- 
Benjamin

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux