kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Schmitt" <scdbackup@gmx.net>
To: kernelnewbies@kernelnewbies.org
Subject: Does "i_mutex" in comments mean inode_lock() in code ?
Date: Tue, 18 Aug 2020 09:02:35 +0200	[thread overview]
Message-ID: <24370731797047302436@scdbackup.webframe.org> (raw)

Hi,

is function inode_lock() the thing which controls what lots of comments
call "i_mutex" ?

I am in particular riddling over this comment in include/linux/fs.h :

/*
 * NOTE: unlike i_size_read(), i_size_write() does need locking around it
 * (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount
 * can be lost, resulting in subsequent i_size_read() calls spinning forever.
 */

because i cannot find any example in the git tree by
  grep -r mutex_unlock'.*[^a-z]'i_mutex .
and the same for mutex_lock or mutex_trylock.

But i see lots of comments mentioning an "i_mutex" structure element by
  grep -r '.*->'i_mutex .

The nearest discovery to what i search for is in include/linux/fs.h
  static inline void inode_lock(struct inode *inode)
It has lots of call instances in the code.
But in contrast to "->imutex" i found not a glimpse of documentation.
(Well it has enough room to hide from me ...)

So is this the call by which i can reserve a cdrom device file inode
before i call i_size_write() ?

If so, shouldn't the comment in fs.h be "... (normally inode_lock) ..." ?


Have a nice day :)

Thomas


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

                 reply	other threads:[~2020-08-18  7:03 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=24370731797047302436@scdbackup.webframe.org \
    --to=scdbackup@gmx.net \
    --cc=kernelnewbies@kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).