History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull VFS fixes from Al Viro: "A bunch of assorted fixes, most of them followups to overlayfs merge" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ovl: initialize ->is_cursor Return short read or 0 at end of a raw device, not EIO isofs: don't bother with ->d_op for normal case isofs_cmp(): we'll never see a dentry for . or .. overlayfs: fix lockdep misannotation ovl: fix check for cursor overlayfs: barriers for opening upper-layer directory rcu: Provide counterpart to rcu_dereference() for non-RCU situations staging: android: logger: Fix log corruption regression

Linus Torvalds committed 12 years ago

Commit 7e05b802 parents 4cb8c35 9f2f7d49 files · +50 −58Browse files

Showing the changes to include/linux (2 of 9 files). Show all

Unified · Split

2 files
  1. include/linux/fs.h +7 −3
  2. include/linux/rcupdate.h +15 −0
include/linux/fs.h+7−3
@@ -639,11 +639,13 @@ static inline int inode_unhashed(struct inode *inode) · 638 unmodified lines
639 * 2: child/target639 * 2: child/target
640 * 3: xattr640 * 3: xattr
641 * 4: second non-directory641 * 4: second non-directory
642 * The last is for certain operations (such as rename) which lock two642 * 5: second parent (when locking independent directories in rename)
643 *
644 * I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two
643 * non-directories at once.645 * non-directories at once.
644 *646 *
645 * The locking order between these classes is647 * The locking order between these classes is
646 * parent -> child -> normal -> xattr -> second non-directory648 * parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory
647 */649 */
648enum inode_i_mutex_lock_class650enum inode_i_mutex_lock_class
649{651{
@@ -651,7 +653,8 @@ enum inode_i_mutex_lock_class · 1 unmodified line
651 I_MUTEX_PARENT,653 I_MUTEX_PARENT,
652 I_MUTEX_CHILD,654 I_MUTEX_CHILD,
653 I_MUTEX_XATTR,655 I_MUTEX_XATTR,
654 I_MUTEX_NONDIR2656 I_MUTEX_NONDIR2,
657 I_MUTEX_PARENT2,
655};658};
656 659
657void lock_two_nondirectories(struct inode *, struct inode*);660void lock_two_nondirectories(struct inode *, struct inode*);
@@ -2466,6 +2469,7 @@ extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, lo · 1808 unmodified lines
2466extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);2469extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
2467 2470
2468/* fs/block_dev.c */2471/* fs/block_dev.c */
2472extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to);
2469extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);2473extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);
2470extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,2474extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2471 int datasync);2475 int datasync);
include/linux/rcupdate.h+15−0
@@ -616,6 +616,21 @@ static inline void rcu_preempt_sleep_check(void) · 615 unmodified lines
616 */616 */
617#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)617#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
618 618
619/**
620 * lockless_dereference() - safely load a pointer for later dereference
621 * @p: The pointer to load
622 *
623 * Similar to rcu_dereference(), but for situations where the pointed-to
624 * object's lifetime is managed by something other than RCU. That
625 * "something other" might be reference counting or simple immortality.
626 */
627#define lockless_dereference(p) \
628({ \
629 typeof(p) _________p1 = ACCESS_ONCE(p); \
630 smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
631 (_________p1); \
632})
633
619/**634/**
620 * rcu_assign_pointer() - assign to RCU-protected pointer635 * rcu_assign_pointer() - assign to RCU-protected pointer
621 * @p: pointer to assign to636 * @p: pointer to assign to