Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfs-6.17-rc1.async.dir' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull async directory updates from Christian Brauner:
"This contains preparatory changes for the asynchronous directory
locking scheme.

While the locking scheme is still very much controversial and we're
still far away from landing any actual changes in that area the
preparatory work that we've been upstreaming for a while now has been
very useful. This is another set of minor changes and cleanups"

* tag 'vfs-6.17-rc1.async.dir' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
exportfs: use lookup_one_unlocked()
coda: use iterate_dir() in coda_readdir()
VFS: Minor fixes for porting.rst
VFS: merge lookup_one_qstr_excl_raw() back into lookup_one_qstr_excl()

+17 -39
-3
Documentation/filesystems/porting.rst
··· 1224 1224 take a qstr instead of separate name and length. QSTR() can be used 1225 1225 when strlen() is needed for the length. 1226 1226 1227 - For try_lookup_noperm() a reference to the qstr is passed in case the 1228 - hash might subsequently be needed. 1229 - 1230 1227 These function no longer do any permission checking - they previously 1231 1228 checked that the caller has 'X' permission on the parent. They must 1232 1229 ONLY be used internally by a filesystem on itself when it knows that
+2 -10
fs/coda/dir.c
··· 429 429 cfi = coda_ftoc(coda_file); 430 430 host_file = cfi->cfi_container; 431 431 432 - if (host_file->f_op->iterate_shared) { 433 - struct inode *host_inode = file_inode(host_file); 434 - ret = -ENOENT; 435 - if (!IS_DEADDIR(host_inode)) { 436 - inode_lock_shared(host_inode); 437 - ret = host_file->f_op->iterate_shared(host_file, ctx); 438 - file_accessed(host_file); 439 - inode_unlock_shared(host_inode); 440 - } 432 + ret = iterate_dir(host_file, ctx); 433 + if (ret != -ENOTDIR) 441 434 return ret; 442 - } 443 435 /* Venus: we must read Venus dirents from a file */ 444 436 return coda_venus_readdir(coda_file, ctx); 445 437 }
+1 -3
fs/exportfs/expfs.c
··· 549 549 goto err_result; 550 550 } 551 551 552 - inode_lock(target_dir->d_inode); 553 - nresult = lookup_one(mnt_idmap(mnt), &QSTR(nbuf), target_dir); 552 + nresult = lookup_one_unlocked(mnt_idmap(mnt), &QSTR(nbuf), target_dir); 554 553 if (!IS_ERR(nresult)) { 555 554 if (unlikely(nresult->d_inode != result->d_inode)) { 556 555 dput(nresult); 557 556 nresult = ERR_PTR(-ESTALE); 558 557 } 559 558 } 560 - inode_unlock(target_dir->d_inode); 561 559 /* 562 560 * At this point we are done with the parent, but it's pinned 563 561 * by the child dentry anyway.
+14 -23
fs/namei.c
··· 1665 1665 return dentry; 1666 1666 } 1667 1667 1668 - static struct dentry *lookup_one_qstr_excl_raw(const struct qstr *name, 1669 - struct dentry *base, 1670 - unsigned int flags) 1668 + /* 1669 + * Parent directory has inode locked exclusive. This is one 1670 + * and only case when ->lookup() gets called on non in-lookup 1671 + * dentries - as the matter of fact, this only gets called 1672 + * when directory is guaranteed to have no in-lookup children 1673 + * at all. 1674 + * Will return -ENOENT if name isn't found and LOOKUP_CREATE wasn't passed. 1675 + * Will return -EEXIST if name is found and LOOKUP_EXCL was passed. 1676 + */ 1677 + struct dentry *lookup_one_qstr_excl(const struct qstr *name, 1678 + struct dentry *base, unsigned int flags) 1671 1679 { 1672 1680 struct dentry *dentry; 1673 1681 struct dentry *old; ··· 1683 1675 1684 1676 dentry = lookup_dcache(name, base, flags); 1685 1677 if (dentry) 1686 - return dentry; 1678 + goto found; 1687 1679 1688 1680 /* Don't create child dentry for a dead directory. */ 1689 1681 dir = base->d_inode; ··· 1699 1691 dput(dentry); 1700 1692 dentry = old; 1701 1693 } 1702 - return dentry; 1703 - } 1704 - 1705 - /* 1706 - * Parent directory has inode locked exclusive. This is one 1707 - * and only case when ->lookup() gets called on non in-lookup 1708 - * dentries - as the matter of fact, this only gets called 1709 - * when directory is guaranteed to have no in-lookup children 1710 - * at all. 1711 - * Will return -ENOENT if name isn't found and LOOKUP_CREATE wasn't passed. 1712 - * Will return -EEXIST if name is found and LOOKUP_EXCL was passed. 1713 - */ 1714 - struct dentry *lookup_one_qstr_excl(const struct qstr *name, 1715 - struct dentry *base, unsigned int flags) 1716 - { 1717 - struct dentry *dentry; 1718 - 1719 - dentry = lookup_one_qstr_excl_raw(name, base, flags); 1694 + found: 1720 1695 if (IS_ERR(dentry)) 1721 1696 return dentry; 1722 1697 if (d_is_negative(dentry) && !(flags & LOOKUP_CREATE)) { ··· 2781 2790 if (unlikely(type != LAST_NORM)) 2782 2791 return ERR_PTR(-EINVAL); 2783 2792 inode_lock_nested(parent_path.dentry->d_inode, I_MUTEX_PARENT); 2784 - d = lookup_one_qstr_excl_raw(&last, parent_path.dentry, 0); 2793 + d = lookup_one_qstr_excl(&last, parent_path.dentry, LOOKUP_CREATE); 2785 2794 if (IS_ERR(d)) { 2786 2795 inode_unlock(parent_path.dentry->d_inode); 2787 2796 return d;