From: Eric Sandeen ext4 needs to deal with 2 different max file offsets for block- and extent-allocated file formats, whereas the s_maxbytes scheme can only deal with one. So, for block-allocated files, we must catch and fix up too-large offsets from within the filesystem. Having iov_shorten exported allows such things as: if (pos + length > sbi->s_bitmap_maxbytes) { nr_segs = iov_shorten((struct iovec *)iov, nr_segs, sbi->s_bitmap_maxbytes - pos); } to fix up too-large writes to these files in ext4_file_write(). Signed-off-by: Eric Sandeen Cc: Mingming Cao Cc: Theodore Ts'o Signed-off-by: Andrew Morton --- fs/read_write.c | 1 + 1 file changed, 1 insertion(+) diff -puN fs/read_write.c~export-iov_shorten-for-ext4s-use fs/read_write.c --- a/fs/read_write.c~export-iov_shorten-for-ext4s-use +++ a/fs/read_write.c @@ -446,6 +446,7 @@ unsigned long iov_shorten(struct iovec * } return seg; } +EXPORT_SYMBOL(iov_shorten) ssize_t do_sync_readv_writev(struct file *filp, const struct iovec *iov, unsigned long nr_segs, size_t len, loff_t *ppos, iov_fn_t fn) _