Loading fs/gfs2/aops.c +16 −18 Original line number Diff line number Diff line Loading @@ -477,31 +477,29 @@ static int gfs2_read_folio(struct file *file, struct folio *folio) * */ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, unsigned size) ssize_t gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, size_t size) { struct address_space *mapping = ip->i_inode.i_mapping; unsigned long index = *pos >> PAGE_SHIFT; unsigned offset = *pos & (PAGE_SIZE - 1); unsigned copied = 0; unsigned amt; struct page *page; size_t copied = 0; do { page = read_cache_page(mapping, index, gfs2_read_folio, NULL); if (IS_ERR(page)) { if (PTR_ERR(page) == -EINTR) size_t offset, chunk; struct folio *folio; folio = read_cache_folio(mapping, index, gfs2_read_folio, NULL); if (IS_ERR(folio)) { if (PTR_ERR(folio) == -EINTR) continue; return PTR_ERR(page); } amt = size - copied; if (offset + size > PAGE_SIZE) amt = PAGE_SIZE - offset; memcpy_from_page(buf + copied, page, offset, amt); put_page(page); copied += amt; index++; offset = 0; return PTR_ERR(folio); } offset = *pos + copied - folio_pos(folio); chunk = min(size - copied, folio_size(folio) - offset); memcpy_from_folio(buf + copied, folio, offset, chunk); index = folio_next_index(folio); folio_put(folio); copied += chunk; } while(copied < size); (*pos) += size; return size; Loading fs/gfs2/inode.h +2 −2 Original line number Diff line number Diff line Loading @@ -13,8 +13,8 @@ #include "util.h" bool gfs2_release_folio(struct folio *folio, gfp_t gfp_mask); extern int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, unsigned size); extern ssize_t gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, size_t size); extern void gfs2_set_aops(struct inode *inode); static inline int gfs2_is_stuffed(const struct gfs2_inode *ip) Loading Loading
fs/gfs2/aops.c +16 −18 Original line number Diff line number Diff line Loading @@ -477,31 +477,29 @@ static int gfs2_read_folio(struct file *file, struct folio *folio) * */ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, unsigned size) ssize_t gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, size_t size) { struct address_space *mapping = ip->i_inode.i_mapping; unsigned long index = *pos >> PAGE_SHIFT; unsigned offset = *pos & (PAGE_SIZE - 1); unsigned copied = 0; unsigned amt; struct page *page; size_t copied = 0; do { page = read_cache_page(mapping, index, gfs2_read_folio, NULL); if (IS_ERR(page)) { if (PTR_ERR(page) == -EINTR) size_t offset, chunk; struct folio *folio; folio = read_cache_folio(mapping, index, gfs2_read_folio, NULL); if (IS_ERR(folio)) { if (PTR_ERR(folio) == -EINTR) continue; return PTR_ERR(page); } amt = size - copied; if (offset + size > PAGE_SIZE) amt = PAGE_SIZE - offset; memcpy_from_page(buf + copied, page, offset, amt); put_page(page); copied += amt; index++; offset = 0; return PTR_ERR(folio); } offset = *pos + copied - folio_pos(folio); chunk = min(size - copied, folio_size(folio) - offset); memcpy_from_folio(buf + copied, folio, offset, chunk); index = folio_next_index(folio); folio_put(folio); copied += chunk; } while(copied < size); (*pos) += size; return size; Loading
fs/gfs2/inode.h +2 −2 Original line number Diff line number Diff line Loading @@ -13,8 +13,8 @@ #include "util.h" bool gfs2_release_folio(struct folio *folio, gfp_t gfp_mask); extern int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, unsigned size); extern ssize_t gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, size_t size); extern void gfs2_set_aops(struct inode *inode); static inline int gfs2_is_stuffed(const struct gfs2_inode *ip) Loading