Skip to content

Commit

Permalink
fs/hfs/catalog.c: use list_for_each_entry in hfs_cat_delete
Browse files Browse the repository at this point in the history
Use list_for_each_entry() instead of list_for_each() to simplify the code.

Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Vyacheslav Dubeyko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
geliangtang authored and torvalds committed Jan 21, 2016
1 parent f057f3b commit 2c35dea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/hfs/catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
{
struct super_block *sb;
struct hfs_find_data fd;
struct list_head *pos;
struct hfs_readdir_data *rd;
int res, type;

hfs_dbg(CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid);
Expand All @@ -240,9 +240,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
}
}

list_for_each(pos, &HFS_I(dir)->open_dir_list) {
struct hfs_readdir_data *rd =
list_entry(pos, struct hfs_readdir_data, list);
list_for_each_entry(rd, &HFS_I(dir)->open_dir_list, list) {
if (fd.tree->keycmp(fd.search_key, (void *)&rd->key) < 0)
rd->file->f_pos--;
}
Expand Down

0 comments on commit 2c35dea

Please sign in to comment.