diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-18 17:39:11 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:53 -0400 |
commit | a30427d92d0bc152b833088e4a305bbeb1a0c162 (patch) | |
tree | 038408c24095627830f8950b3791ea2655270112 /fs/char_dev.c | |
parent | f2b9857eee17797541b845782ade4d7a9d50f843 (diff) |
Add a comment in chrdev_open()
I stared at this code for a while and almost deleted it before
understanding crept into my slow brain. Hopefully this makes life easier
for the next person to happen on it.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'fs/char_dev.c')
-rw-r--r-- | fs/char_dev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c index 68e510b88457..a54d69369b2f 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c | |||
@@ -373,6 +373,8 @@ static int chrdev_open(struct inode *inode, struct file *filp) | |||
373 | return -ENXIO; | 373 | return -ENXIO; |
374 | new = container_of(kobj, struct cdev, kobj); | 374 | new = container_of(kobj, struct cdev, kobj); |
375 | spin_lock(&cdev_lock); | 375 | spin_lock(&cdev_lock); |
376 | /* Check i_cdev again in case somebody beat us to it while | ||
377 | we dropped the lock. */ | ||
376 | p = inode->i_cdev; | 378 | p = inode->i_cdev; |
377 | if (!p) { | 379 | if (!p) { |
378 | inode->i_cdev = p = new; | 380 | inode->i_cdev = p = new; |