diff options
author | Christoph Hellwig <hch@lst.de> | 2017-01-28 02:20:26 -0500 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-01-30 19:32:25 -0500 |
commit | 8ff6daa17b6a64e59bbabaa116b9bd854fa4da1f (patch) | |
tree | 2e3aff37a0a2d813849a5cd73641d3df29955fdc | |
parent | b6f41e448277ff080fea734b93121e6cd7513f0c (diff) |
iomap: constify struct iomap_ops
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/dax.c | 6 | ||||
-rw-r--r-- | fs/ext2/ext2.h | 2 | ||||
-rw-r--r-- | fs/ext2/inode.c | 4 | ||||
-rw-r--r-- | fs/ext4/ext4.h | 2 | ||||
-rw-r--r-- | fs/ext4/inode.c | 2 | ||||
-rw-r--r-- | fs/internal.h | 2 | ||||
-rw-r--r-- | fs/iomap.c | 18 | ||||
-rw-r--r-- | fs/xfs/xfs_iomap.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_iomap.h | 4 | ||||
-rw-r--r-- | include/linux/dax.h | 8 | ||||
-rw-r--r-- | include/linux/iomap.h | 14 |
11 files changed, 33 insertions, 33 deletions
@@ -1074,7 +1074,7 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, | |||
1074 | */ | 1074 | */ |
1075 | ssize_t | 1075 | ssize_t |
1076 | dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, | 1076 | dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
1077 | struct iomap_ops *ops) | 1077 | const struct iomap_ops *ops) |
1078 | { | 1078 | { |
1079 | struct address_space *mapping = iocb->ki_filp->f_mapping; | 1079 | struct address_space *mapping = iocb->ki_filp->f_mapping; |
1080 | struct inode *inode = mapping->host; | 1080 | struct inode *inode = mapping->host; |
@@ -1118,7 +1118,7 @@ static int dax_fault_return(int error) | |||
1118 | * necessary locking for the page fault to proceed successfully. | 1118 | * necessary locking for the page fault to proceed successfully. |
1119 | */ | 1119 | */ |
1120 | int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf, | 1120 | int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf, |
1121 | struct iomap_ops *ops) | 1121 | const struct iomap_ops *ops) |
1122 | { | 1122 | { |
1123 | struct address_space *mapping = vma->vm_file->f_mapping; | 1123 | struct address_space *mapping = vma->vm_file->f_mapping; |
1124 | struct inode *inode = mapping->host; | 1124 | struct inode *inode = mapping->host; |
@@ -1317,7 +1317,7 @@ static int dax_pmd_load_hole(struct vm_area_struct *vma, pmd_t *pmd, | |||
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address, | 1319 | int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address, |
1320 | pmd_t *pmd, unsigned int flags, struct iomap_ops *ops) | 1320 | pmd_t *pmd, unsigned int flags, const struct iomap_ops *ops) |
1321 | { | 1321 | { |
1322 | struct address_space *mapping = vma->vm_file->f_mapping; | 1322 | struct address_space *mapping = vma->vm_file->f_mapping; |
1323 | unsigned long pmd_addr = address & PMD_MASK; | 1323 | unsigned long pmd_addr = address & PMD_MASK; |
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 37e2be784ac7..5e64de9c5093 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h | |||
@@ -814,7 +814,7 @@ extern const struct file_operations ext2_file_operations; | |||
814 | /* inode.c */ | 814 | /* inode.c */ |
815 | extern const struct address_space_operations ext2_aops; | 815 | extern const struct address_space_operations ext2_aops; |
816 | extern const struct address_space_operations ext2_nobh_aops; | 816 | extern const struct address_space_operations ext2_nobh_aops; |
817 | extern struct iomap_ops ext2_iomap_ops; | 817 | extern const struct iomap_ops ext2_iomap_ops; |
818 | 818 | ||
819 | /* namei.c */ | 819 | /* namei.c */ |
820 | extern const struct inode_operations ext2_dir_inode_operations; | 820 | extern const struct inode_operations ext2_dir_inode_operations; |
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index f073bfca694b..128cce540645 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -842,13 +842,13 @@ ext2_iomap_end(struct inode *inode, loff_t offset, loff_t length, | |||
842 | return 0; | 842 | return 0; |
843 | } | 843 | } |
844 | 844 | ||
845 | struct iomap_ops ext2_iomap_ops = { | 845 | const struct iomap_ops ext2_iomap_ops = { |
846 | .iomap_begin = ext2_iomap_begin, | 846 | .iomap_begin = ext2_iomap_begin, |
847 | .iomap_end = ext2_iomap_end, | 847 | .iomap_end = ext2_iomap_end, |
848 | }; | 848 | }; |
849 | #else | 849 | #else |
850 | /* Define empty ops for !CONFIG_FS_DAX case to avoid ugly ifdefs */ | 850 | /* Define empty ops for !CONFIG_FS_DAX case to avoid ugly ifdefs */ |
851 | struct iomap_ops ext2_iomap_ops; | 851 | const struct iomap_ops ext2_iomap_ops; |
852 | #endif /* CONFIG_FS_DAX */ | 852 | #endif /* CONFIG_FS_DAX */ |
853 | 853 | ||
854 | int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 854 | int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 2163c1e69f2a..ce70403c4707 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -3253,7 +3253,7 @@ static inline void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end) | |||
3253 | } | 3253 | } |
3254 | } | 3254 | } |
3255 | 3255 | ||
3256 | extern struct iomap_ops ext4_iomap_ops; | 3256 | extern const struct iomap_ops ext4_iomap_ops; |
3257 | 3257 | ||
3258 | #endif /* __KERNEL__ */ | 3258 | #endif /* __KERNEL__ */ |
3259 | 3259 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 88d57af1b516..96c2e12cc5d6 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3420,7 +3420,7 @@ orphan_del: | |||
3420 | return ret; | 3420 | return ret; |
3421 | } | 3421 | } |
3422 | 3422 | ||
3423 | struct iomap_ops ext4_iomap_ops = { | 3423 | const struct iomap_ops ext4_iomap_ops = { |
3424 | .iomap_begin = ext4_iomap_begin, | 3424 | .iomap_begin = ext4_iomap_begin, |
3425 | .iomap_end = ext4_iomap_end, | 3425 | .iomap_end = ext4_iomap_end, |
3426 | }; | 3426 | }; |
diff --git a/fs/internal.h b/fs/internal.h index b63cf3af2dc2..11c6d89dce9c 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
@@ -182,7 +182,7 @@ typedef loff_t (*iomap_actor_t)(struct inode *inode, loff_t pos, loff_t len, | |||
182 | void *data, struct iomap *iomap); | 182 | void *data, struct iomap *iomap); |
183 | 183 | ||
184 | loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length, | 184 | loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length, |
185 | unsigned flags, struct iomap_ops *ops, void *data, | 185 | unsigned flags, const struct iomap_ops *ops, void *data, |
186 | iomap_actor_t actor); | 186 | iomap_actor_t actor); |
187 | 187 | ||
188 | /* direct-io.c: */ | 188 | /* direct-io.c: */ |
diff --git a/fs/iomap.c b/fs/iomap.c index 354a123f170e..7f08ca03d95d 100644 --- a/fs/iomap.c +++ b/fs/iomap.c | |||
@@ -41,7 +41,7 @@ | |||
41 | */ | 41 | */ |
42 | loff_t | 42 | loff_t |
43 | iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags, | 43 | iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags, |
44 | struct iomap_ops *ops, void *data, iomap_actor_t actor) | 44 | const struct iomap_ops *ops, void *data, iomap_actor_t actor) |
45 | { | 45 | { |
46 | struct iomap iomap = { 0 }; | 46 | struct iomap iomap = { 0 }; |
47 | loff_t written = 0, ret; | 47 | loff_t written = 0, ret; |
@@ -232,7 +232,7 @@ again: | |||
232 | 232 | ||
233 | ssize_t | 233 | ssize_t |
234 | iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *iter, | 234 | iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *iter, |
235 | struct iomap_ops *ops) | 235 | const struct iomap_ops *ops) |
236 | { | 236 | { |
237 | struct inode *inode = iocb->ki_filp->f_mapping->host; | 237 | struct inode *inode = iocb->ki_filp->f_mapping->host; |
238 | loff_t pos = iocb->ki_pos, ret = 0, written = 0; | 238 | loff_t pos = iocb->ki_pos, ret = 0, written = 0; |
@@ -315,7 +315,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data, | |||
315 | 315 | ||
316 | int | 316 | int |
317 | iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len, | 317 | iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len, |
318 | struct iomap_ops *ops) | 318 | const struct iomap_ops *ops) |
319 | { | 319 | { |
320 | loff_t ret; | 320 | loff_t ret; |
321 | 321 | ||
@@ -395,7 +395,7 @@ iomap_zero_range_actor(struct inode *inode, loff_t pos, loff_t count, | |||
395 | 395 | ||
396 | int | 396 | int |
397 | iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero, | 397 | iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero, |
398 | struct iomap_ops *ops) | 398 | const struct iomap_ops *ops) |
399 | { | 399 | { |
400 | loff_t ret; | 400 | loff_t ret; |
401 | 401 | ||
@@ -415,7 +415,7 @@ EXPORT_SYMBOL_GPL(iomap_zero_range); | |||
415 | 415 | ||
416 | int | 416 | int |
417 | iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, | 417 | iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, |
418 | struct iomap_ops *ops) | 418 | const struct iomap_ops *ops) |
419 | { | 419 | { |
420 | unsigned blocksize = (1 << inode->i_blkbits); | 420 | unsigned blocksize = (1 << inode->i_blkbits); |
421 | unsigned off = pos & (blocksize - 1); | 421 | unsigned off = pos & (blocksize - 1); |
@@ -443,7 +443,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length, | |||
443 | } | 443 | } |
444 | 444 | ||
445 | int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | 445 | int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
446 | struct iomap_ops *ops) | 446 | const struct iomap_ops *ops) |
447 | { | 447 | { |
448 | struct page *page = vmf->page; | 448 | struct page *page = vmf->page; |
449 | struct inode *inode = file_inode(vma->vm_file); | 449 | struct inode *inode = file_inode(vma->vm_file); |
@@ -542,7 +542,7 @@ iomap_fiemap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, | |||
542 | } | 542 | } |
543 | 543 | ||
544 | int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi, | 544 | int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi, |
545 | loff_t start, loff_t len, struct iomap_ops *ops) | 545 | loff_t start, loff_t len, const struct iomap_ops *ops) |
546 | { | 546 | { |
547 | struct fiemap_ctx ctx; | 547 | struct fiemap_ctx ctx; |
548 | loff_t ret; | 548 | loff_t ret; |
@@ -836,8 +836,8 @@ iomap_dio_actor(struct inode *inode, loff_t pos, loff_t length, | |||
836 | } | 836 | } |
837 | 837 | ||
838 | ssize_t | 838 | ssize_t |
839 | iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, struct iomap_ops *ops, | 839 | iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, |
840 | iomap_dio_end_io_t end_io) | 840 | const struct iomap_ops *ops, iomap_dio_end_io_t end_io) |
841 | { | 841 | { |
842 | struct address_space *mapping = iocb->ki_filp->f_mapping; | 842 | struct address_space *mapping = iocb->ki_filp->f_mapping; |
843 | struct inode *inode = file_inode(iocb->ki_filp); | 843 | struct inode *inode = file_inode(iocb->ki_filp); |
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 1aa3abd67b36..25ed98324b27 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -1144,7 +1144,7 @@ xfs_file_iomap_end( | |||
1144 | return 0; | 1144 | return 0; |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | struct iomap_ops xfs_iomap_ops = { | 1147 | const struct iomap_ops xfs_iomap_ops = { |
1148 | .iomap_begin = xfs_file_iomap_begin, | 1148 | .iomap_begin = xfs_file_iomap_begin, |
1149 | .iomap_end = xfs_file_iomap_end, | 1149 | .iomap_end = xfs_file_iomap_end, |
1150 | }; | 1150 | }; |
@@ -1190,6 +1190,6 @@ out_unlock: | |||
1190 | return error; | 1190 | return error; |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | struct iomap_ops xfs_xattr_iomap_ops = { | 1193 | const struct iomap_ops xfs_xattr_iomap_ops = { |
1194 | .iomap_begin = xfs_xattr_iomap_begin, | 1194 | .iomap_begin = xfs_xattr_iomap_begin, |
1195 | }; | 1195 | }; |
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h index 6d45cf01fcff..705224b66b6a 100644 --- a/fs/xfs/xfs_iomap.h +++ b/fs/xfs/xfs_iomap.h | |||
@@ -33,7 +33,7 @@ void xfs_bmbt_to_iomap(struct xfs_inode *, struct iomap *, | |||
33 | struct xfs_bmbt_irec *); | 33 | struct xfs_bmbt_irec *); |
34 | xfs_extlen_t xfs_eof_alignment(struct xfs_inode *ip, xfs_extlen_t extsize); | 34 | xfs_extlen_t xfs_eof_alignment(struct xfs_inode *ip, xfs_extlen_t extsize); |
35 | 35 | ||
36 | extern struct iomap_ops xfs_iomap_ops; | 36 | extern const struct iomap_ops xfs_iomap_ops; |
37 | extern struct iomap_ops xfs_xattr_iomap_ops; | 37 | extern const struct iomap_ops xfs_xattr_iomap_ops; |
38 | 38 | ||
39 | #endif /* __XFS_IOMAP_H__*/ | 39 | #endif /* __XFS_IOMAP_H__*/ |
diff --git a/include/linux/dax.h b/include/linux/dax.h index 24ad71173995..2983e52efd07 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
@@ -37,9 +37,9 @@ static inline void *dax_radix_locked_entry(sector_t sector, unsigned long flags) | |||
37 | } | 37 | } |
38 | 38 | ||
39 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, | 39 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
40 | struct iomap_ops *ops); | 40 | const struct iomap_ops *ops); |
41 | int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf, | 41 | int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf, |
42 | struct iomap_ops *ops); | 42 | const struct iomap_ops *ops); |
43 | int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index); | 43 | int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index); |
44 | int dax_invalidate_mapping_entry(struct address_space *mapping, pgoff_t index); | 44 | int dax_invalidate_mapping_entry(struct address_space *mapping, pgoff_t index); |
45 | int dax_invalidate_mapping_entry_sync(struct address_space *mapping, | 45 | int dax_invalidate_mapping_entry_sync(struct address_space *mapping, |
@@ -72,7 +72,7 @@ static inline unsigned int dax_radix_order(void *entry) | |||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address, | 74 | int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address, |
75 | pmd_t *pmd, unsigned int flags, struct iomap_ops *ops); | 75 | pmd_t *pmd, unsigned int flags, const struct iomap_ops *ops); |
76 | #else | 76 | #else |
77 | static inline unsigned int dax_radix_order(void *entry) | 77 | static inline unsigned int dax_radix_order(void *entry) |
78 | { | 78 | { |
@@ -80,7 +80,7 @@ static inline unsigned int dax_radix_order(void *entry) | |||
80 | } | 80 | } |
81 | static inline int dax_iomap_pmd_fault(struct vm_area_struct *vma, | 81 | static inline int dax_iomap_pmd_fault(struct vm_area_struct *vma, |
82 | unsigned long address, pmd_t *pmd, unsigned int flags, | 82 | unsigned long address, pmd_t *pmd, unsigned int flags, |
83 | struct iomap_ops *ops) | 83 | const struct iomap_ops *ops) |
84 | { | 84 | { |
85 | return VM_FAULT_FALLBACK; | 85 | return VM_FAULT_FALLBACK; |
86 | } | 86 | } |
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index a4c94b86401e..891459caa278 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h | |||
@@ -72,17 +72,17 @@ struct iomap_ops { | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from, | 74 | ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from, |
75 | struct iomap_ops *ops); | 75 | const struct iomap_ops *ops); |
76 | int iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len, | 76 | int iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len, |
77 | struct iomap_ops *ops); | 77 | const struct iomap_ops *ops); |
78 | int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, | 78 | int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, |
79 | bool *did_zero, struct iomap_ops *ops); | 79 | bool *did_zero, const struct iomap_ops *ops); |
80 | int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, | 80 | int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, |
81 | struct iomap_ops *ops); | 81 | const struct iomap_ops *ops); |
82 | int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | 82 | int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
83 | struct iomap_ops *ops); | 83 | const struct iomap_ops *ops); |
84 | int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 84 | int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
85 | loff_t start, loff_t len, struct iomap_ops *ops); | 85 | loff_t start, loff_t len, const struct iomap_ops *ops); |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * Flags for direct I/O ->end_io: | 88 | * Flags for direct I/O ->end_io: |
@@ -92,6 +92,6 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
92 | typedef int (iomap_dio_end_io_t)(struct kiocb *iocb, ssize_t ret, | 92 | typedef int (iomap_dio_end_io_t)(struct kiocb *iocb, ssize_t ret, |
93 | unsigned flags); | 93 | unsigned flags); |
94 | ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, | 94 | ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, |
95 | struct iomap_ops *ops, iomap_dio_end_io_t end_io); | 95 | const struct iomap_ops *ops, iomap_dio_end_io_t end_io); |
96 | 96 | ||
97 | #endif /* LINUX_IOMAP_H */ | 97 | #endif /* LINUX_IOMAP_H */ |