Skip to content

Commit

Permalink
fs: Do not overload update_time
Browse files Browse the repository at this point in the history
update_time() also has an internal function pointer
update_time. Even though this works correctly, it is
confusing to the readers.

Just use a regular if statement to call the generic
function or the function pointer.

Suggested-by: Al Viro <[email protected]>
Signed-off-by: Deepa Dinamani <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
deepa-hub authored and Al Viro committed Dec 9, 2019
1 parent ba70609 commit 23b424d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,12 +1675,9 @@ EXPORT_SYMBOL(generic_update_time);
*/
static int update_time(struct inode *inode, struct timespec64 *time, int flags)
{
int (*update_time)(struct inode *, struct timespec64 *, int);

update_time = inode->i_op->update_time ? inode->i_op->update_time :
generic_update_time;

return update_time(inode, time, flags);
if (inode->i_op->update_time)
return inode->i_op->update_time(inode, time, flags);
return generic_update_time(inode, time, flags);
}

/**
Expand Down

0 comments on commit 23b424d

Please sign in to comment.