Skip to content

Commit

Permalink
Btrfs: The file argument for fsync() is never null
Browse files Browse the repository at this point in the history
The "file" argument for fsync is never null so we can remove this check.

What drew my attention here is that 7ea8085: "drop unused dentry
argument to ->fsync" introduced an unconditional dereference at the
start of the function and that generated a smatch warning.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Dan Carpenter authored and Chris Mason committed Jun 11, 2010
1 parent 834e747 commit 6f902af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
/*
* ok we haven't committed the transaction yet, lets do a commit
*/
if (file && file->private_data)
if (file->private_data)
btrfs_ioctl_trans_end(file);

trans = btrfs_start_transaction(root, 0);
Expand Down

0 comments on commit 6f902af

Please sign in to comment.