xfs_aops.c (9c1852b459f04f6309e40d1d167512b0a5598529) | xfs_aops.c (0a417b8dc1f10b03e8f558b8a831f07ec4c23795) |
---|---|
1/* 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * --- 1138 unchanged lines hidden (view full) --- 1147 1148 /* 1149 * mm accommodates an old ext3 case where clean pages might not have had 1150 * the dirty bit cleared. Thus, it can send actual dirty pages to 1151 * ->releasepage() via shrink_active_list(). Conversely, 1152 * block_invalidatepage() can send pages that are still marked dirty 1153 * but otherwise have invalidated buffers. 1154 * | 1/* 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * --- 1138 unchanged lines hidden (view full) --- 1147 1148 /* 1149 * mm accommodates an old ext3 case where clean pages might not have had 1150 * the dirty bit cleared. Thus, it can send actual dirty pages to 1151 * ->releasepage() via shrink_active_list(). Conversely, 1152 * block_invalidatepage() can send pages that are still marked dirty 1153 * but otherwise have invalidated buffers. 1154 * |
1155 * We've historically freed buffers on the latter. Instead, quietly 1156 * filter out all dirty pages to avoid spurious buffer state warnings. 1157 * This can likely be removed once shrink_active_list() is fixed. | 1155 * We want to release the latter to avoid unnecessary buildup of the 1156 * LRU, skip the former and warn if we've left any lingering 1157 * delalloc/unwritten buffers on clean pages. Skip pages with delalloc 1158 * or unwritten buffers and warn if the page is not dirty. Otherwise 1159 * try to release the buffers. |
1158 */ | 1160 */ |
1159 if (PageDirty(page)) 1160 return 0; 1161 | |
1162 xfs_count_page_state(page, &delalloc, &unwritten); 1163 | 1161 xfs_count_page_state(page, &delalloc, &unwritten); 1162 |
1164 if (WARN_ON_ONCE(delalloc)) | 1163 if (delalloc) { 1164 WARN_ON_ONCE(!PageDirty(page)); |
1165 return 0; | 1165 return 0; |
1166 if (WARN_ON_ONCE(unwritten)) | 1166 } 1167 if (unwritten) { 1168 WARN_ON_ONCE(!PageDirty(page)); |
1167 return 0; | 1169 return 0; |
1170 } |
|
1168 1169 return try_to_free_buffers(page); 1170} 1171 1172/* 1173 * If this is O_DIRECT or the mpage code calling tell them how large the mapping 1174 * is, so that we can avoid repeated get_blocks calls. 1175 * --- 251 unchanged lines hidden --- | 1171 1172 return try_to_free_buffers(page); 1173} 1174 1175/* 1176 * If this is O_DIRECT or the mpage code calling tell them how large the mapping 1177 * is, so that we can avoid repeated get_blocks calls. 1178 * --- 251 unchanged lines hidden --- |