namei.c (8737f3a1b3c6a38a2a064552d4536633a5a16cd3) namei.c (3516586a424ea5727be089da6541cbd5644f0497)
1/*
2 * linux/fs/namei.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7/*
8 * Some corrections by tytso.

--- 1695 unchanged lines hidden (view full) ---

1704 if (filp == NULL)
1705 goto exit_parent;
1706 nd.intent.open.file = filp;
1707 nd.intent.open.flags = flag;
1708 nd.intent.open.create_mode = mode;
1709 dir = nd.path.dentry;
1710 nd.flags &= ~LOOKUP_PARENT;
1711 nd.flags |= LOOKUP_CREATE | LOOKUP_OPEN;
1/*
2 * linux/fs/namei.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7/*
8 * Some corrections by tytso.

--- 1695 unchanged lines hidden (view full) ---

1704 if (filp == NULL)
1705 goto exit_parent;
1706 nd.intent.open.file = filp;
1707 nd.intent.open.flags = flag;
1708 nd.intent.open.create_mode = mode;
1709 dir = nd.path.dentry;
1710 nd.flags &= ~LOOKUP_PARENT;
1711 nd.flags |= LOOKUP_CREATE | LOOKUP_OPEN;
1712 if (flag & O_EXCL)
1713 nd.flags |= LOOKUP_EXCL;
1712 mutex_lock(&dir->d_inode->i_mutex);
1713 path.dentry = lookup_hash(&nd);
1714 path.mnt = nd.path.mnt;
1715
1716do_last:
1717 error = PTR_ERR(path.dentry);
1718 if (IS_ERR(path.dentry)) {
1719 mutex_unlock(&dir->d_inode->i_mutex);

--- 181 unchanged lines hidden (view full) ---

1901 mutex_lock_nested(&nd->path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
1902 /*
1903 * Yucky last component or no last component at all?
1904 * (foo/., foo/.., /////)
1905 */
1906 if (nd->last_type != LAST_NORM)
1907 goto fail;
1908 nd->flags &= ~LOOKUP_PARENT;
1714 mutex_lock(&dir->d_inode->i_mutex);
1715 path.dentry = lookup_hash(&nd);
1716 path.mnt = nd.path.mnt;
1717
1718do_last:
1719 error = PTR_ERR(path.dentry);
1720 if (IS_ERR(path.dentry)) {
1721 mutex_unlock(&dir->d_inode->i_mutex);

--- 181 unchanged lines hidden (view full) ---

1903 mutex_lock_nested(&nd->path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
1904 /*
1905 * Yucky last component or no last component at all?
1906 * (foo/., foo/.., /////)
1907 */
1908 if (nd->last_type != LAST_NORM)
1909 goto fail;
1910 nd->flags &= ~LOOKUP_PARENT;
1909 nd->flags |= LOOKUP_CREATE;
1911 nd->flags |= LOOKUP_CREATE | LOOKUP_EXCL;
1910 nd->intent.open.flags = O_EXCL;
1911
1912 /*
1913 * Do the final lookup.
1914 */
1915 dentry = lookup_hash(nd);
1916 if (IS_ERR(dentry))
1917 goto fail;

--- 951 unchanged lines hidden ---
1912 nd->intent.open.flags = O_EXCL;
1913
1914 /*
1915 * Do the final lookup.
1916 */
1917 dentry = lookup_hash(nd);
1918 if (IS_ERR(dentry))
1919 goto fail;

--- 951 unchanged lines hidden ---