diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-02 13:28:43 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-02 13:28:43 -0500 |
| commit | 7e05b807b93cc553bc2aa5ae8fac620cece34720 (patch) | |
| tree | 6240b09f201c210d7e3f5cd46086a64852530de2 /include/linux | |
| parent | 4cb8c3593bbb884c5c282b1d8502a0930235fe88 (diff) | |
| parent | 9f2f7d4c8dfcf4617af5de6ea381b91deac3db48 (diff) | |
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
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 10 | ||||
| -rw-r--r-- | include/linux/rcupdate.h | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4e41a4a331bb..9ab779e8a63c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -639,11 +639,13 @@ static inline int inode_unhashed(struct inode *inode) | |||
| 639 | * 2: child/target | 639 | * 2: child/target |
| 640 | * 3: xattr | 640 | * 3: xattr |
| 641 | * 4: second non-directory | 641 | * 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 | ||
| 643 | * non-directories at once. | 645 | * non-directories at once. |
| 644 | * | 646 | * |
| 645 | * The locking order between these classes is | 647 | * 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 |
| 647 | */ | 649 | */ |
| 648 | enum inode_i_mutex_lock_class | 650 | enum inode_i_mutex_lock_class |
| 649 | { | 651 | { |
| @@ -651,7 +653,8 @@ enum inode_i_mutex_lock_class | |||
| 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_NONDIR2 | 656 | I_MUTEX_NONDIR2, |
| 657 | I_MUTEX_PARENT2, | ||
| 655 | }; | 658 | }; |
| 656 | 659 | ||
| 657 | void lock_two_nondirectories(struct inode *, struct inode*); | 660 | 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 | |||
| 2466 | extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 2469 | extern 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 */ |
| 2472 | extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to); | ||
| 2469 | extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from); | 2473 | extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from); |
| 2470 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, | 2474 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, |
| 2471 | int datasync); | 2475 | int datasync); |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index a4a819ffb2d1..53ff1a752d7e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -617,6 +617,21 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 617 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) | 617 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) |
| 618 | 618 | ||
| 619 | /** | 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 | |||
| 634 | /** | ||
| 620 | * rcu_assign_pointer() - assign to RCU-protected pointer | 635 | * rcu_assign_pointer() - assign to RCU-protected pointer |
| 621 | * @p: pointer to assign to | 636 | * @p: pointer to assign to |
| 622 | * @v: value to assign (publish) | 637 | * @v: value to assign (publish) |
