Commit bfd7e5f
fs/read_write: Generalize generic_copy_file_checks()
Prepare for adding copy_file_range() support for block devices by making
the following changes:
- Change file_inode(file) into file->f_mapping->host. Although only one
inode is associated with regular files, two inodes are associated
with block devices. file->f_mapping->host is the primary block device
inode.
- Change S_ISREG() into S_ISREG() || S_ISBLK().
- Add an inode->i_mode & S_IFMT check that verifies that source and
destination have the same type (block device or regular file).
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Anuj Gupta <[email protected]>
Signed-off-by: Nitesh Shetty <[email protected]>
[ bvanassche: rewrote patch description ]
Signed-off-by: Bart Van Assche <[email protected]>1 parent 0ea7840 commit bfd7e5f
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1484 | 1484 | | |
1485 | 1485 | | |
1486 | 1486 | | |
1487 | | - | |
1488 | | - | |
| 1487 | + | |
| 1488 | + | |
1489 | 1489 | | |
1490 | 1490 | | |
1491 | 1491 | | |
| |||
1791 | 1791 | | |
1792 | 1792 | | |
1793 | 1793 | | |
1794 | | - | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
1795 | 1797 | | |
1796 | 1798 | | |
1797 | 1799 | | |
| |||
0 commit comments