diff options
Diffstat (limited to 'Documentation/filesystems/porting')
-rw-r--r-- | Documentation/filesystems/porting | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index a7e9746ee7ea..b12c89538680 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -273,3 +273,48 @@ it's safe to remove it. If you don't need it, remove it. | |||
273 | deliberate; as soon as struct block_device * is propagated in a reasonable | 273 | deliberate; as soon as struct block_device * is propagated in a reasonable |
274 | way by that code fixing will become trivial; until then nothing can be | 274 | way by that code fixing will become trivial; until then nothing can be |
275 | done. | 275 | done. |
276 | |||
277 | [mandatory] | ||
278 | |||
279 | block truncatation on error exit from ->write_begin, and ->direct_IO | ||
280 | moved from generic methods (block_write_begin, cont_write_begin, | ||
281 | nobh_write_begin, blockdev_direct_IO*) to callers. Take a look at | ||
282 | ext2_write_failed and callers for an example. | ||
283 | |||
284 | [mandatory] | ||
285 | |||
286 | ->truncate is going away. The whole truncate sequence needs to be | ||
287 | implemented in ->setattr, which is now mandatory for filesystems | ||
288 | implementing on-disk size changes. Start with a copy of the old inode_setattr | ||
289 | and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to | ||
290 | be in order of zeroing blocks using block_truncate_page or similar helpers, | ||
291 | size update and on finally on-disk truncation which should not fail. | ||
292 | inode_change_ok now includes the size checks for ATTR_SIZE and must be called | ||
293 | in the beginning of ->setattr unconditionally. | ||
294 | |||
295 | [mandatory] | ||
296 | |||
297 | ->clear_inode() and ->delete_inode() are gone; ->evict_inode() should | ||
298 | be used instead. It gets called whenever the inode is evicted, whether it has | ||
299 | remaining links or not. Caller does *not* evict the pagecache or inode-associated | ||
300 | metadata buffers; getting rid of those is responsibility of method, as it had | ||
301 | been for ->delete_inode(). | ||
302 | ->drop_inode() returns int now; it's called on final iput() with inode_lock | ||
303 | held and it returns true if filesystems wants the inode to be dropped. As before, | ||
304 | generic_drop_inode() is still the default and it's been updated appropriately. | ||
305 | generic_delete_inode() is also alive and it consists simply of return 1. Note that | ||
306 | all actual eviction work is done by caller after ->drop_inode() returns. | ||
307 | clear_inode() is gone; use end_writeback() instead. As before, it must | ||
308 | be called exactly once on each call of ->evict_inode() (as it used to be for | ||
309 | each call of ->delete_inode()). Unlike before, if you are using inode-associated | ||
310 | metadata buffers (i.e. mark_buffer_dirty_inode()), it's your responsibility to | ||
311 | call invalidate_inode_buffers() before end_writeback(). | ||
312 | No async writeback (and thus no calls of ->write_inode()) will happen | ||
313 | after end_writeback() returns, so actions that should not overlap with ->write_inode() | ||
314 | (e.g. freeing on-disk inode if i_nlink is 0) ought to be done after that call. | ||
315 | |||
316 | NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out | ||
317 | if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput() | ||
318 | may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly | ||
319 | free the on-disk inode, you may end up doing that while ->write_inode() is writing | ||
320 | to it. | ||