|
21 | 21 | #define dprintf(x...) |
22 | 22 | #endif |
23 | 23 |
|
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); |
26 | 25 | static struct buffer_head *bfs_find_entry(struct inode *dir, |
27 | 26 | const struct qstr *child, |
28 | 27 | struct bfs_dirent **res_dir); |
@@ -111,8 +110,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, |
111 | 110 | mark_inode_dirty(inode); |
112 | 111 | bfs_dump_imap("create", s); |
113 | 112 |
|
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); |
116 | 114 | if (err) { |
117 | 115 | inode_dec_link_count(inode); |
118 | 116 | mutex_unlock(&info->bfs_lock); |
@@ -154,8 +152,7 @@ static int bfs_link(struct dentry *old, struct inode *dir, |
154 | 152 | int err; |
155 | 153 |
|
156 | 154 | 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); |
159 | 156 | if (err) { |
160 | 157 | mutex_unlock(&info->bfs_lock); |
161 | 158 | return err; |
@@ -237,9 +234,7 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry, |
237 | 234 | new_bh = NULL; |
238 | 235 | } |
239 | 236 | 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, |
243 | 238 | old_inode->i_ino); |
244 | 239 | if (error) |
245 | 240 | goto end_rename; |
@@ -269,9 +264,10 @@ const struct inode_operations bfs_dir_inops = { |
269 | 264 | .rename = bfs_rename, |
270 | 265 | }; |
271 | 266 |
|
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) |
274 | 268 | { |
| 269 | + const unsigned char *name = child->name; |
| 270 | + int namelen = child->len; |
275 | 271 | struct buffer_head *bh; |
276 | 272 | struct bfs_dirent *de; |
277 | 273 | int block, sblock, eblock, off, pos; |
|
0 commit comments