inode.c (d5abfb1b7b26086db19ee430dea7282f01d4ef44) | inode.c (60b99a1b9fa731453e1b69a3e0b3e4dcab7a6ea5) |
---|---|
1/* 2 * inode.c 3 * 4 * PURPOSE 5 * Inode handling routines for the OSTA-UDF(tm) filesystem. 6 * 7 * COPYRIGHT 8 * This file is distributed under the terms of the GNU General Public --- 217 unchanged lines hidden (view full) --- 226 return mpage_read_folio(folio, udf_get_block); 227} 228 229static void udf_readahead(struct readahead_control *rac) 230{ 231 mpage_readahead(rac, udf_get_block); 232} 233 | 1/* 2 * inode.c 3 * 4 * PURPOSE 5 * Inode handling routines for the OSTA-UDF(tm) filesystem. 6 * 7 * COPYRIGHT 8 * This file is distributed under the terms of the GNU General Public --- 217 unchanged lines hidden (view full) --- 226 return mpage_read_folio(folio, udf_get_block); 227} 228 229static void udf_readahead(struct readahead_control *rac) 230{ 231 mpage_readahead(rac, udf_get_block); 232} 233 |
234static int udf_write_begin(struct file *file, struct address_space *mapping, | 234int udf_write_begin(struct file *file, struct address_space *mapping, |
235 loff_t pos, unsigned len, 236 struct page **pagep, void **fsdata) 237{ | 235 loff_t pos, unsigned len, 236 struct page **pagep, void **fsdata) 237{ |
238 struct udf_inode_info *iinfo = UDF_I(file_inode(file)); 239 struct page *page; |
|
238 int ret; 239 | 240 int ret; 241 |
240 ret = block_write_begin(mapping, pos, len, pagep, udf_get_block); 241 if (unlikely(ret)) 242 udf_write_failed(mapping, pos + len); 243 return ret; | 242 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { 243 ret = block_write_begin(mapping, pos, len, pagep, 244 udf_get_block); 245 if (unlikely(ret)) 246 udf_write_failed(mapping, pos + len); 247 return ret; 248 } 249 if (WARN_ON_ONCE(pos >= PAGE_SIZE)) 250 return -EIO; 251 page = grab_cache_page_write_begin(mapping, 0); 252 if (!page) 253 return -ENOMEM; 254 *pagep = page; 255 if (!PageUptodate(page)) 256 udf_adinicb_readpage(page); 257 return 0; |
244} 245 246ssize_t udf_direct_IO(struct kiocb *iocb, struct iov_iter *iter) 247{ 248 struct file *file = iocb->ki_filp; 249 struct address_space *mapping = file->f_mapping; 250 struct inode *inode = mapping->host; 251 size_t count = iov_iter_count(iter); --- 2091 unchanged lines hidden --- | 258} 259 260ssize_t udf_direct_IO(struct kiocb *iocb, struct iov_iter *iter) 261{ 262 struct file *file = iocb->ki_filp; 263 struct address_space *mapping = file->f_mapping; 264 struct inode *inode = mapping->host; 265 size_t count = iov_iter_count(iter); --- 2091 unchanged lines hidden --- |