aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/fs.h20
-rw-r--r--include/linux/rcupdate.h15
3 files changed, 35 insertions, 8 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index b2a2a08523bf..1c2f1b84468b 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -124,15 +124,15 @@ struct dentry {
124 void *d_fsdata; /* fs-specific data */ 124 void *d_fsdata; /* fs-specific data */
125 125
126 struct list_head d_lru; /* LRU list */ 126 struct list_head d_lru; /* LRU list */
127 struct list_head d_child; /* child of parent list */
128 struct list_head d_subdirs; /* our children */
127 /* 129 /*
128 * d_child and d_rcu can share memory 130 * d_alias and d_rcu can share memory
129 */ 131 */
130 union { 132 union {
131 struct list_head d_child; /* child of parent list */ 133 struct hlist_node d_alias; /* inode alias list */
132 struct rcu_head d_rcu; 134 struct rcu_head d_rcu;
133 } d_u; 135 } d_u;
134 struct list_head d_subdirs; /* our children */
135 struct hlist_node d_alias; /* inode alias list */
136}; 136};
137 137
138/* 138/*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4e41a4a331bb..1c12c681803f 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 */
648enum inode_i_mutex_lock_class 650enum 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
657void lock_two_nondirectories(struct inode *, struct inode*); 660void lock_two_nondirectories(struct inode *, struct inode*);
@@ -1464,7 +1467,10 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
1464 * This allows the kernel to read directories into kernel space or 1467 * This allows the kernel to read directories into kernel space or
1465 * to have different dirent layouts depending on the binary type. 1468 * to have different dirent layouts depending on the binary type.
1466 */ 1469 */
1467typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); 1470struct dir_context;
1471typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
1472 unsigned);
1473
1468struct dir_context { 1474struct dir_context {
1469 const filldir_t actor; 1475 const filldir_t actor;
1470 loff_t pos; 1476 loff_t pos;
@@ -2466,6 +2472,7 @@ extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, lo
2466extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 2472extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
2467 2473
2468/* fs/block_dev.c */ 2474/* fs/block_dev.c */
2475extern 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); 2476extern 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, 2477extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2471 int datasync); 2478 int datasync);
@@ -2782,6 +2789,11 @@ static inline void inode_has_no_xattr(struct inode *inode)
2782 inode->i_flags |= S_NOSEC; 2789 inode->i_flags |= S_NOSEC;
2783} 2790}
2784 2791
2792static inline bool is_root_inode(struct inode *inode)
2793{
2794 return inode == inode->i_sb->s_root->d_inode;
2795}
2796
2785static inline bool dir_emit(struct dir_context *ctx, 2797static inline bool dir_emit(struct dir_context *ctx,
2786 const char *name, int namelen, 2798 const char *name, int namelen,
2787 u64 ino, unsigned type) 2799 u64 ino, unsigned type)
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)