| @@ -887,12 +887,19 @@ __iomap_read_page(struct inode *inode, loff_t offset) · 886 unmodified lines |
| 887 | } | 887 | } |
| 888 | | 888 | |
| 889 | static loff_t | 889 | static loff_t |
| 890 | iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data, | 890 | iomap_unshare_actor(struct inode *inode, loff_t pos, loff_t length, void *data, |
| 891 | struct iomap *iomap) | 891 | struct iomap *iomap) |
| 892 | { | 892 | { |
| 893 | long status = 0; | 893 | long status = 0; |
| 894 | ssize_t written = 0; | 894 | ssize_t written = 0; |
| 895 | | 895 | |
| | 896 | /* don't bother with blocks that are not shared to start with */ |
| | 897 | if (!(iomap->flags & IOMAP_F_SHARED)) |
| | 898 | return length; |
| | 899 | /* don't bother with holes or unwritten extents */ |
| | 900 | if (iomap->type == IOMAP_HOLE || iomap->type == IOMAP_UNWRITTEN) |
| | 901 | return length; |
| | 902 | |
| 896 | do { | 903 | do { |
| 897 | struct page *page, *rpage; | 904 | struct page *page, *rpage; |
| 898 | unsigned long offset; /* Offset into pagecache page */ | 905 | unsigned long offset; /* Offset into pagecache page */ |
| @@ -932,14 +939,14 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data, · 33 unmodified lines |
| 932 | } | 939 | } |
| 933 | | 940 | |
| 934 | int | 941 | int |
| 935 | iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len, | 942 | iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len, |
| 936 | const struct iomap_ops *ops) | 943 | const struct iomap_ops *ops) |
| 937 | { | 944 | { |
| 938 | loff_t ret; | 945 | loff_t ret; |
| 939 | | 946 | |
| 940 | while (len) { | 947 | while (len) { |
| 941 | ret = iomap_apply(inode, pos, len, IOMAP_WRITE, ops, NULL, | 948 | ret = iomap_apply(inode, pos, len, IOMAP_WRITE, ops, NULL, |
| 942 | iomap_dirty_actor); | 949 | iomap_unshare_actor); |
| 943 | if (ret <= 0) | 950 | if (ret <= 0) |
| 944 | return ret; | 951 | return ret; |
| 945 | pos += ret; | 952 | pos += ret; |
| @@ -948,7 +955,7 @@ iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len, · 2 unmodified lines |
| 948 | | 955 | |
| 949 | return 0; | 956 | return 0; |
| 950 | } | 957 | } |
| 951 | EXPORT_SYMBOL_GPL(iomap_file_dirty); | 958 | EXPORT_SYMBOL_GPL(iomap_file_unshare); |
| 952 | | 959 | |
| 953 | static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset, | 960 | static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset, |
| 954 | unsigned bytes, struct iomap *iomap) | 961 | unsigned bytes, struct iomap *iomap) |