Lines Matching +full:protect +full:- +full:exec
3 ---
13 ---
16 New methods: ->alloc_inode() and ->destroy_inode().
18 Remove inode->u.foo_inode_i
21 /* fs-private stuff */
29 Use FOO_I(inode) instead of &inode->u.foo_inode_i;
31 Add foo_alloc_inode() and foo_destroy_inode() - the former should allocate
32 foo_inode_info and return the address of ->vfs_inode, the latter should free
33 FOO_I(inode) (see in-tree filesystems for examples).
35 Make them ->alloc_inode and ->destroy_inode in your super_operations.
42 ---
45 Change of file_system_type method (->read_super to ->get_sb)
47 ->read_super() is no more. Ditto for DECLARE_FSTYPE and DECLARE_FSTYPE_DEV.
50 success and negative number in case of error (-EINVAL unless you have more
63 Replace DECLARE_FSTYPE... with explicit initializer and have ->get_sb set as
66 ---
69 Locking change: ->s_vfs_rename_sem is taken only by cross-directory renames.
71 global exclusion between renames for some internal purpose - you need to
75 ---
78 Now we have the exclusion between ->lookup() and directory removal (by
79 ->rmdir() and ->rename()). If you used to need that exclusion and do
80 it by internal locking (most of filesystems couldn't care less) - you
83 ---
86 ->lookup(), ->truncate(), ->create(), ->unlink(), ->mknod(), ->mkdir(),
87 ->rmdir(), ->link(), ->lseek(), ->symlink(), ->rename()
88 and ->readdir() are called without BKL now. Grab it on entry, drop upon return
89 - that will guarantee the same locking you used to have. If your method or its
90 parts do not need BKL - better yet, now you can shift lock_kernel() and
91 unlock_kernel() so that they would protect exactly what needs to be
94 ---
100 ---
103 check for ->link() target not being a directory is done by callers. Feel
106 ---
109 ->link() callers hold ->i_mutex on the object we are linking to. Some of your
112 ---
115 new file_system_type method - kill_sb(superblock). If you are converting
116 an existing filesystem, set it according to ->fs_flags:
117 FS_REQUIRES_DEV - kill_block_super
118 FS_LITTER - kill_litter_super
119 neither - kill_anon_super
120 FS_LITTER is gone - just remove it from fs_flags.
122 ---
125 FS_SINGLE is gone (actually, that had happened back when ->get_sb()
126 went in - and hadn't been documented ;-/). Just remove it from fs_flags
127 (and see ->get_sb() entry for other actions).
129 ---
132 ->setattr() is called without BKL now. Caller _always_ holds ->i_mutex, so
133 watch for ->i_mutex-grabbing code that might be used by your ->setattr().
134 Callers of notify_change() need ->i_mutex now.
136 ---
146 a standard helper function for decode_fh, and provide file-system specific
158 ---
171 should be a non-blocking function that initializes those parts of a
187 if (inode->i_state & I_NEW) {
200 ---
203 ->getattr() finally getting used. See instances in nfs, minix, etc.
205 ---
208 ->revalidate() is gone. If your filesystem had it - provide ->getattr()
209 and let it call whatever you had as ->revlidate() + (for symlinks that
210 had ->revalidate()) add calls in ->follow_link()/->readlink().
212 ---
215 ->d_parent changes are not protected by BKL anymore. Read access is safe
217 * filesystem has no cross-directory rename()
219 ->d_parent of ->lookup() argument).
220 * we are called from ->rename().
221 * the child's ->d_lock is held
223 not protected by the conditions above is risky even in the old tree - you
225 a few holes of that kind - unprotected access to ->d_parent leading to
228 ---
231 FS_NOMOUNT is gone. If you use it - just set SB_NOUSER in flags
234 ---
241 ---
244 ->permission() is called without BKL now. Grab it on entry, drop upon
245 return - that will guarantee the same locking you used to have. If
246 your method or its parts do not need BKL - better yet, now you can
247 shift lock_kernel() and unlock_kernel() so that they would protect
250 ---
253 ->statfs() is now called without BKL held. BKL should have been
257 ---
262 ---
267 ---
277 block truncatation on error exit from ->write_begin, and ->direct_IO
284 ->truncate is gone. The whole truncate sequence needs to be
285 implemented in ->setattr, which is now mandatory for filesystems
286 implementing on-disk size changes. Start with a copy of the old inode_setattr
289 size update and on finally on-disk truncation which should not fail.
291 for ATTR_SIZE and must be called in the beginning of ->setattr unconditionally.
295 ->clear_inode() and ->delete_inode() are gone; ->evict_inode() should
297 remaining links or not. Caller does *not* evict the pagecache or inode-associated
300 (or after) ->evict_inode() is called.
302 ->drop_inode() returns int now; it's called on final iput() with
303 inode->i_lock held and it returns true if filesystems wants the inode to be
307 ->drop_inode() returns.
310 ->evict_inode() (as it used to be for each call of ->delete_inode()). Unlike
311 before, if you are using inode-associated metadata buffers (i.e.
315 NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
317 may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly
318 free the on-disk inode, you may end up doing that while ->write_inode() is writing
321 ---
329 ---
336 ---
343 ---
346 for details of what locks to replace dcache_lock with in order to protect
347 particular things. Most of the time, a filesystem only needs ->d_lock, which
350 --
353 Filesystems must RCU-free their inodes, if they can have been accessed
354 via rcu-walk path walk (basically, if the file can have had a path name in the
362 --
364 vfs now tries to do path walking in "rcu-walk mode", which avoids
366 Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes
368 filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so
370 the benefits of rcu-walk mode. We will begin to add filesystem callbacks that
371 are rcu-walk aware, shown below. Filesystems should take advantage of this
374 --
377 the filesystem provides it), which requires dropping out of rcu-walk mode. This
378 may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be
379 returned if the filesystem cannot handle rcu-walk. See
383 directory inodes on the way down a path walk (to check for exec permission). It
384 must now be rcu-walk aware (mask & MAY_NOT_BLOCK). See
387 --
389 In ->fallocate() you must check the mode option passed in. If your
391 file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode.
396 --
398 ->get_sb() is gone. Switch to use of ->mount(). Typically it's just
400 function type. If you were doing it manually, just switch from setting ->mnt_root
403 --
405 ->permission() and generic_permission()have lost flags
408 has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl
411 --
413 If you implement your own ->llseek() you must handle SEEK_HOLE and
414 SEEK_DATA. You can hanle this by returning -EINVAL, but it would be nicer to
419 of the file. If the offset is i_size or greater return -ENXIO in either case.
422 If you have your own ->fsync() you must make sure to call
424 You must also keep in mind that ->fsync() is not called with i_mutex held
428 --
434 --
436 The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and
437 ->lookup() do *not* take struct nameidata anymore; just the flags.
438 --
440 ->create() doesn't take struct nameidata *; unlike the previous
442 local filesystems can ignore tha argument - they are guaranteed that the
444 --
446 FS_REVAL_DOT is gone; if you used to have it, add ->d_weak_revalidate()
448 --
451 --
453 ->readdir() is gone now; switch to ->iterate()
456 from ->follow_link for normal symlinks, or nd_jump_link for magic
458 --
461 called with both ->i_lock and inode_hash_lock held; the former is *not*
463 of the in-tree instances did). inode_hash_lock is still held,
466 --
469 need now. Remember that they have opposite orders of arguments ;-/
470 --
474 --
476 never call ->read() and ->write() directly; use __vfs_{read,write} or
477 wrappers; instead of checking for ->write or ->read being NULL, look for
478 FMODE_CAN_{WRITE,READ} in file->f_mode.
479 --
481 do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
483 --
485 ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter.
486 ---
488 for embedded ("fast") symlinks just set inode->i_link to wherever the
489 symlink body is and use simple_follow_link() as ->follow_link().
490 --
492 calling conventions for ->follow_link() have changed. Instead of returning
495 nameidata isn't passed at all - nd_jump_link() doesn't need it and
497 --
499 calling conventions for ->put_link() have changed. It gets inode instead of
501 is non-NULL. Note that link body isn't available anymore, so if you need it,
503 --
512 --
514 ->follow_link() is replaced with ->get_link(); same API, except that
515 * ->get_link() gets inode as a separate argument
516 * ->get_link() may be called in RCU mode - in that case NULL
518 --
520 ->get_link() gets struct delayed_call *done now, and should do
522 ->put_link() is gone - just give the destructor to set_delayed_call()
523 in ->get_link().
524 --
526 ->getxattr() and xattr_handler.get() get dentry and inode passed separately.
527 dentry might be yet to be attached to inode, so do _not_ use its ->d_inode
530 --
534 assume that non-NULL value in ->i_nlink at ->destroy_inode() implies that
535 it's a symlink. Checking ->i_mode is really needed now. In-tree we had
538 --
540 ->i_mutex is replaced with ->i_rwsem now. inode_lock() et.al. work as
541 they used to - they just take it exclusive. However, ->lookup() may be
543 * use d_instantiate) and d_rehash() separately - use d_add() or
545 * use d_rehash() alone - call d_add(new_dentry, NULL) instead.
546 * in the unlikely case when (read-only) access to filesystem
548 yourself. None of the in-tree filesystems needed that.
549 * rely on ->d_parent and ->d_name not changing after dentry has
551 in-tree instances relied upon that.
553 will not happen in parallel ("same" in the sense of your ->d_compare()).
556 --
558 ->iterate_shared() is added; it's a parallel variant of ->iterate().
562 Exclusion between that method and all directory-modifying ones is
565 Often enough ->iterate() can serve as ->iterate_shared() without any
566 changes - it is a read-only operation, after all. If you have any
567 per-inode or per-dentry in-core data structures modified by ->iterate(),
569 do dcache pre-seeding, you'll need to switch to d_alloc_parallel() for
570 that; look for in-tree examples.
574 --
576 ->atomic_open() calls without O_CREAT may happen in parallel.
577 --
579 ->setxattr() and xattr_handler.set() get dentry and inode passed separately.
580 dentry might be yet to be attached to inode, so do _not_ use its ->d_inode
583 ->d_instantiate() uses not just ->getxattr() but ->setxattr() as well.
584 --
586 ->d_compare() doesn't get parent as a separate argument anymore. If you
587 used it for finding the struct super_block involved, dentry->d_sb will
588 work just as well; if it's something more complicated, use dentry->d_parent.
590 the same value - in RCU mode it could change under you.
591 --
593 ->rename() has an added flags argument. Any flags not handled by the
595 --
597 ->readlink is optional for symlinks. Don't set, unless filesystem needs
599 --
601 ->getattr() is now passed a struct path rather than a vfsmount and
604 supporting any statx-specific features may ignore the new arguments.
605 --
607 ->atomic_open() calling conventions have changed. Gone is int *opened,
609 FMODE_OPENED/FMODE_CREATED, set in file->f_mode. Additionally, return
612 does not need any changes in ->atomic_open() instances.
613 --
624 original, on failure - ERR_PTR().
625 --
630 --
634 nonwithstanding, failure exits in ->atomic_open() instances should