diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-07 23:49:20 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-14 09:15:26 -0400 |
commit | 6a96ba54418be740303765c0f52be028573cb99a (patch) | |
tree | 1766b39499c1e0b18ed42f0ef31f64357fa8c8ab /fs/namei.c | |
parent | fe2d35ff0d18a2c93993b0d7d46f846ff4331b72 (diff) |
kill __lookup_one_len()
only one caller left
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/fs/namei.c b/fs/namei.c index 9595b4a55c39..f6f3ef47bc74 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1759,28 +1759,6 @@ static struct dentry *lookup_hash(struct nameidata *nd) | |||
1759 | return __lookup_hash(&nd->last, nd->path.dentry, nd); | 1759 | return __lookup_hash(&nd->last, nd->path.dentry, nd); |
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | static int __lookup_one_len(const char *name, struct qstr *this, | ||
1763 | struct dentry *base, int len) | ||
1764 | { | ||
1765 | unsigned long hash; | ||
1766 | unsigned int c; | ||
1767 | |||
1768 | this->name = name; | ||
1769 | this->len = len; | ||
1770 | if (!len) | ||
1771 | return -EACCES; | ||
1772 | |||
1773 | hash = init_name_hash(); | ||
1774 | while (len--) { | ||
1775 | c = *(const unsigned char *)name++; | ||
1776 | if (c == '/' || c == '\0') | ||
1777 | return -EACCES; | ||
1778 | hash = partial_name_hash(c, hash); | ||
1779 | } | ||
1780 | this->hash = end_name_hash(hash); | ||
1781 | return 0; | ||
1782 | } | ||
1783 | |||
1784 | /** | 1762 | /** |
1785 | * lookup_one_len - filesystem helper to lookup single pathname component | 1763 | * lookup_one_len - filesystem helper to lookup single pathname component |
1786 | * @name: pathname component to lookup | 1764 | * @name: pathname component to lookup |
@@ -1794,14 +1772,25 @@ static int __lookup_one_len(const char *name, struct qstr *this, | |||
1794 | */ | 1772 | */ |
1795 | struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) | 1773 | struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) |
1796 | { | 1774 | { |
1797 | int err; | ||
1798 | struct qstr this; | 1775 | struct qstr this; |
1776 | unsigned long hash; | ||
1777 | unsigned int c; | ||
1799 | 1778 | ||
1800 | WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); | 1779 | WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); |
1801 | 1780 | ||
1802 | err = __lookup_one_len(name, &this, base, len); | 1781 | this.name = name; |
1803 | if (err) | 1782 | this.len = len; |
1804 | return ERR_PTR(err); | 1783 | if (!len) |
1784 | return ERR_PTR(-EACCES); | ||
1785 | |||
1786 | hash = init_name_hash(); | ||
1787 | while (len--) { | ||
1788 | c = *(const unsigned char *)name++; | ||
1789 | if (c == '/' || c == '\0') | ||
1790 | return ERR_PTR(-EACCES); | ||
1791 | hash = partial_name_hash(c, hash); | ||
1792 | } | ||
1793 | this.hash = end_name_hash(hash); | ||
1805 | 1794 | ||
1806 | return __lookup_hash(&this, base, NULL); | 1795 | return __lookup_hash(&this, base, NULL); |
1807 | } | 1796 | } |