Skip to content

Commit b455ecd

Browse files
author
Al Viro
committed
bfs_add_entry: pass name/len as qstr pointer
same story as with bfs_find_entry() Cc: "Tigran A. Aivazian" <aivazian.tigran@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 33ebdeb commit b455ecd

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

‎fs/bfs/dir.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#define dprintf(x...)
2222
#endif
2323

24-
static int bfs_add_entry(struct inode *dir, const unsigned char *name,
25-
int namelen, int ino);
24+
static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino);
2625
static struct buffer_head *bfs_find_entry(struct inode *dir,
2726
const struct qstr *child,
2827
struct bfs_dirent **res_dir);
@@ -111,8 +110,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
111110
mark_inode_dirty(inode);
112111
bfs_dump_imap("create", s);
113112

114-
err = bfs_add_entry(dir, dentry->d_name.name, dentry->d_name.len,
115-
inode->i_ino);
113+
err = bfs_add_entry(dir, &dentry->d_name, inode->i_ino);
116114
if (err) {
117115
inode_dec_link_count(inode);
118116
mutex_unlock(&info->bfs_lock);
@@ -154,8 +152,7 @@ static int bfs_link(struct dentry *old, struct inode *dir,
154152
int err;
155153

156154
mutex_lock(&info->bfs_lock);
157-
err = bfs_add_entry(dir, new->d_name.name, new->d_name.len,
158-
inode->i_ino);
155+
err = bfs_add_entry(dir, &new->d_name, inode->i_ino);
159156
if (err) {
160157
mutex_unlock(&info->bfs_lock);
161158
return err;
@@ -237,9 +234,7 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
237234
new_bh = NULL;
238235
}
239236
if (!new_bh) {
240-
error = bfs_add_entry(new_dir,
241-
new_dentry->d_name.name,
242-
new_dentry->d_name.len,
237+
error = bfs_add_entry(new_dir, &new_dentry->d_name,
243238
old_inode->i_ino);
244239
if (error)
245240
goto end_rename;
@@ -269,9 +264,10 @@ const struct inode_operations bfs_dir_inops = {
269264
.rename = bfs_rename,
270265
};
271266

272-
static int bfs_add_entry(struct inode *dir, const unsigned char *name,
273-
int namelen, int ino)
267+
static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino)
274268
{
269+
const unsigned char *name = child->name;
270+
int namelen = child->len;
275271
struct buffer_head *bh;
276272
struct bfs_dirent *de;
277273
int block, sblock, eblock, off, pos;

0 commit comments

Comments
 (0)