From: "Raghu R. Arur" <rra2002@cs.columbia.edu>
To: linux-mm@kvack.org
Subject: i_writecount doubt
Date: Sat, 28 Jun 2003 13:54:26 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0306281353370.8819-100000@delhi.clic.cs.columbia.edu> (raw)
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>
reply other threads:[~2003-06-28 17:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0306281353370.8819-100000@delhi.clic.cs.columbia.edu \
--to=rra2002@cs.columbia.edu \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox