linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* i_writecount doubt
@ 2003-06-28 17:54 Raghu R. Arur
  0 siblings, 0 replies; only message in thread
From: Raghu R. Arur @ 2003-06-28 17:54 UTC (permalink / raw)
  To: linux-mm


182  if (file) {
183  struct inode *inode = file->f_dentry->d_inode;
184  get_file(file);
185  if (tmp->vm_flags & VM_DENYWRITE)
186  atomic_dec(&inode->i_writecount);
187

  I was looking at the code of dup_mmap() in fork.c. I didnt understand
something over here. The code above is checking whether the vm_area of the
parent that the new process (child process)is copying, has read-only
permission or read-write
permission. If it has read-only permission then the inode's i_writecount
is decremented. I saw in the vm documentation that if i_writecount is
negative then it is read-only and if it is positive then it is positive.
According to my understanding the inode data that we are accessing is
global. So some processes might have read-only access
to the file and some have read-write access to the file. So how can we
decide whether the process has the correct access just by seeing the value
of i_writecount of the inode. OR am i missing something over here.

  Can anyone please explain whats happening over here.

 thanks,
raghu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-28 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-28 17:54 i_writecount doubt Raghu R. Arur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox