/*
* Look up and maybe create and open the last component.
*
-- * Must be called with i_mutex held on parent.
- *
- * Returns 0 if the file was successfully atomically created (if necessary) and
- * opened. In this case the file will be returned attached to @file.
- *
- * Returns 1 if the file was not completely opened at this time, though lookups
- * and creations will have been performed and the dentry returned in @path will
- * be positive upon return if O_CREAT was specified. If O_CREAT wasn't
- * specified then a negative dentry may be returned.
++ * Must be called with parent locked (exclusive in O_CREAT case).
*
- * Returns 0 if the file was successfully atomically created (if necessary) and
- * opened. In this case the file will be returned attached to @file.
- * An error code is returned otherwise.
++ * Returns 0 on success, that is, if
++ * the file was successfully atomically created (if necessary) and opened, or
++ * the file was not completely opened at this time, though lookups and
++ * creations were performed.
++ * These case are distinguished by presence of FMODE_OPENED on file->f_mode.
++ * In the latter case dentry returned in @path might be negative if O_CREAT
++ * hadn't been specified.
*
- * Returns 1 if the file was not completely opened at this time, though lookups
- * and creations will have been performed and the dentry returned in @path will
- * be positive upon return if O_CREAT was specified. If O_CREAT wasn't
- * specified then a negative dentry may be returned.
- *
- * An error code is returned otherwise.
- *
-- * FILE_CREATE will be set in @*opened if the dentry was created and will be
-- * cleared otherwise prior to returning.
++ * An error code is returned on failure.
*/
static int lookup_open(struct nameidata *nd, struct path *path,
struct file *file,