diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-30 19:14:44 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-22 14:27:50 -0400 |
commit | b455ecd4bb4db1419c45139535fc931572177882 (patch) | |
tree | 0975eed5965ff4c8a4e68d55931d892d0b2f13ae /fs/bfs | |
parent | 33ebdebece6d5d0c11ad34d8583e29801941af2d (diff) |
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>
Diffstat (limited to 'fs/bfs')
-rw-r--r-- | fs/bfs/dir.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 528c69746f7d..f32f21c3bbc7 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #define dprintf(x...) | 21 | #define dprintf(x...) |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | static int bfs_add_entry(struct inode *dir, const unsigned char *name, | 24 | static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino); |
25 | int namelen, int ino); | ||
26 | static struct buffer_head *bfs_find_entry(struct inode *dir, | 25 | static struct buffer_head *bfs_find_entry(struct inode *dir, |
27 | const struct qstr *child, | 26 | const struct qstr *child, |
28 | struct bfs_dirent **res_dir); | 27 | struct bfs_dirent **res_dir); |
@@ -111,8 +110,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
111 | mark_inode_dirty(inode); | 110 | mark_inode_dirty(inode); |
112 | bfs_dump_imap("create", s); | 111 | bfs_dump_imap("create", s); |
113 | 112 | ||
114 | err = bfs_add_entry(dir, dentry->d_name.name, dentry->d_name.len, | 113 | err = bfs_add_entry(dir, &dentry->d_name, inode->i_ino); |
115 | inode->i_ino); | ||
116 | if (err) { | 114 | if (err) { |
117 | inode_dec_link_count(inode); | 115 | inode_dec_link_count(inode); |
118 | mutex_unlock(&info->bfs_lock); | 116 | mutex_unlock(&info->bfs_lock); |
@@ -154,8 +152,7 @@ static int bfs_link(struct dentry *old, struct inode *dir, | |||
154 | int err; | 152 | int err; |
155 | 153 | ||
156 | mutex_lock(&info->bfs_lock); | 154 | mutex_lock(&info->bfs_lock); |
157 | err = bfs_add_entry(dir, new->d_name.name, new->d_name.len, | 155 | err = bfs_add_entry(dir, &new->d_name, inode->i_ino); |
158 | inode->i_ino); | ||
159 | if (err) { | 156 | if (err) { |
160 | mutex_unlock(&info->bfs_lock); | 157 | mutex_unlock(&info->bfs_lock); |
161 | return err; | 158 | return err; |
@@ -237,9 +234,7 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
237 | new_bh = NULL; | 234 | new_bh = NULL; |
238 | } | 235 | } |
239 | if (!new_bh) { | 236 | if (!new_bh) { |
240 | error = bfs_add_entry(new_dir, | 237 | error = bfs_add_entry(new_dir, &new_dentry->d_name, |
241 | new_dentry->d_name.name, | ||
242 | new_dentry->d_name.len, | ||
243 | old_inode->i_ino); | 238 | old_inode->i_ino); |
244 | if (error) | 239 | if (error) |
245 | goto end_rename; | 240 | goto end_rename; |
@@ -269,9 +264,10 @@ const struct inode_operations bfs_dir_inops = { | |||
269 | .rename = bfs_rename, | 264 | .rename = bfs_rename, |
270 | }; | 265 | }; |
271 | 266 | ||
272 | static int bfs_add_entry(struct inode *dir, const unsigned char *name, | 267 | static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) |
273 | int namelen, int ino) | ||
274 | { | 268 | { |
269 | const unsigned char *name = child->name; | ||
270 | int namelen = child->len; | ||
275 | struct buffer_head *bh; | 271 | struct buffer_head *bh; |
276 | struct bfs_dirent *de; | 272 | struct bfs_dirent *de; |
277 | int block, sblock, eblock, off, pos; | 273 | int block, sblock, eblock, off, pos; |