mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-07 06:15:23 +02:00
Merge branch 'v6.12/standard/base' into v6.12/standard/preempt-rt/nvidia-sdk-5.15/nvidia-soc
This commit is contained in:
commit
aa258cf831
|
@ -561,7 +561,7 @@ static int yaffs_write_begin(struct file *filp, struct address_space *mapping,
|
||||||
struct page **pagep, void **fsdata)
|
struct page **pagep, void **fsdata)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
struct page *pg = NULL;
|
__maybe_unused struct page *pg = NULL;
|
||||||
pgoff_t index = pos >> PAGE_CACHE_SHIFT;
|
pgoff_t index = pos >> PAGE_CACHE_SHIFT;
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -570,20 +570,20 @@ static int yaffs_write_begin(struct file *filp, struct address_space *mapping,
|
||||||
/* Get a page */
|
/* Get a page */
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
|
||||||
*foliop = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
|
*foliop = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
|
||||||
+ mapping_gfp_mask(mapping));
|
mapping_gfp_mask(mapping));
|
||||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
|
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
|
||||||
pg = grab_cache_page_write_begin(mapping, index, flags);
|
pg = grab_cache_page_write_begin(mapping, index, flags);
|
||||||
#else
|
#else
|
||||||
pg = __grab_cache_page(mapping, index);
|
pg = __grab_cache_page(mapping, index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!*foliop) {
|
if (IS_ERR(*foliop)) {
|
||||||
ret = -ENOMEM;
|
ret = PTR_ERR(*foliop);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
yaffs_trace(YAFFS_TRACE_OS,
|
yaffs_trace(YAFFS_TRACE_OS,
|
||||||
"start yaffs_write_begin index %d(%x) uptodate %d",
|
"start yaffs_write_begin index %d(%x) uptodate %d",
|
||||||
(int)index, (int)index, Page_Uptodate(pg) ? 1 : 0);
|
(int)index, (int)index, folio_test_uptodate(*foliop) ? 1 : 0);
|
||||||
|
|
||||||
/* Get fs space */
|
/* Get fs space */
|
||||||
space_held = yaffs_hold_space(filp);
|
space_held = yaffs_hold_space(filp);
|
||||||
|
@ -595,8 +595,8 @@ static int yaffs_write_begin(struct file *filp, struct address_space *mapping,
|
||||||
|
|
||||||
/* Update page if required */
|
/* Update page if required */
|
||||||
|
|
||||||
if (!Page_Uptodate(pg))
|
if (folio_test_uptodate(*foliop))
|
||||||
ret = yaffs_readpage_nolock(filp, pg);
|
ret = yaffs_readpage_unlock(filp, &(*foliop)->page);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -611,9 +611,9 @@ out:
|
||||||
"end yaffs_write_begin fail returning %d", ret);
|
"end yaffs_write_begin fail returning %d", ret);
|
||||||
if (space_held)
|
if (space_held)
|
||||||
yaffs_release_space(filp);
|
yaffs_release_space(filp);
|
||||||
if (pg) {
|
if (!IS_ERR(*foliop)) {
|
||||||
unlock_page(pg);
|
folio_unlock(*foliop);
|
||||||
page_cache_release(pg);
|
folio_put(*foliop);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user