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
639639 * 2: child/target
640640 * 3: xattr
641641 * 4: second non-directory
642− * The last is for certain operations (such as rename) which lock two
642+ * 5: second parent (when locking independent directories in rename)
643+ *
644+ * I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two
643645 * non-directories at once.
644646 *
645647 * The locking order between these classes is
646− * parent -> child -> normal -> xattr -> second non-directory
648+ * parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory
647649 */
648650 enum inode_i_mutex_lock_class
649651 {
@@ -651,7 +653,8 @@ enum inode_i_mutex_lock_class · 1 unmodified line
651653 I_MUTEX_PARENT,
652654 I_MUTEX_CHILD,
653655 I_MUTEX_XATTR,
654− I_MUTEX_NONDIR2
656+ I_MUTEX_NONDIR2,
657+ I_MUTEX_PARENT2,
655658 };
656659
657660 void 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
24662469 extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
24672470
24682471 /* fs/block_dev.c */
2472+extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to);
24692473 extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);
24702474 extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
24712475 int datasync);
include/linux/rcupdate.h+15−0
@@ -616,6 +616,21 @@ static inline void rcu_preempt_sleep_check(void) · 615 unmodified lines
616616 */
617617 #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
618618
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+
619634 /**
620635 * rcu_assign_pointer() - assign to RCU-protected pointer
621636 * @p: pointer to assign to