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

qnx6: Convert qnx6_find_entry() to qnx6_find_ino()

It's hard to return a directory entry from qnx6_find_entry()
because it might be a long dir_entry with a different format.
So stick with the convention of returning an inode number,
but rename it to qnx6_find_ino() to reflect what it actually does,
and move the call to qnx6_put_page() inside the function which
lets us get rid of the res_page parameter.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Matthew Wilcox (Oracle) and committed by
Christian Brauner
5563040e b2aa6155

+4 -10
+2 -5
fs/qnx6/dir.c
··· 213 213 } 214 214 215 215 216 - unsigned qnx6_find_entry(int len, struct inode *dir, const char *name, 217 - struct page **res_page) 216 + unsigned qnx6_find_ino(int len, struct inode *dir, const char *name) 218 217 { 219 218 struct super_block *s = dir->i_sb; 220 219 struct qnx6_inode_info *ei = QNX6_I(dir); ··· 223 224 unsigned ino; 224 225 struct qnx6_dir_entry *de; 225 226 struct qnx6_long_dir_entry *lde; 226 - 227 - *res_page = NULL; 228 227 229 228 if (npages == 0) 230 229 return 0; ··· 264 267 return 0; 265 268 266 269 found: 267 - *res_page = &folio->page; 268 270 ei->i_dir_start_lookup = n; 271 + qnx6_put_page(&folio->page); 269 272 return ino; 270 273 } 271 274
+1 -3
fs/qnx6/namei.c
··· 17 17 unsigned int flags) 18 18 { 19 19 unsigned ino; 20 - struct page *page; 21 20 struct inode *foundinode = NULL; 22 21 const char *name = dentry->d_name.name; 23 22 int len = dentry->d_name.len; ··· 24 25 if (len > QNX6_LONG_NAME_MAX) 25 26 return ERR_PTR(-ENAMETOOLONG); 26 27 27 - ino = qnx6_find_entry(len, dir, name, &page); 28 + ino = qnx6_find_ino(len, dir, name); 28 29 if (ino) { 29 30 foundinode = qnx6_iget(dir->i_sb, ino); 30 - qnx6_put_page(page); 31 31 if (IS_ERR(foundinode)) 32 32 pr_debug("lookup->iget -> error %ld\n", 33 33 PTR_ERR(foundinode));
+1 -2
fs/qnx6/qnx6.h
··· 132 132 put_page(page); 133 133 } 134 134 135 - extern unsigned qnx6_find_entry(int len, struct inode *dir, const char *name, 136 - struct page **res_page); 135 + unsigned qnx6_find_ino(int len, struct inode *dir, const char *name);