hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/dcache.h
....@@ -63,9 +63,10 @@
6363 struct dentry_stat_t {
6464 long nr_dentry;
6565 long nr_unused;
66
- long age_limit; /* age in seconds */
67
- long want_pages; /* pages requested by system */
68
- long dummy[2];
66
+ long age_limit; /* age in seconds */
67
+ long want_pages; /* pages requested by system */
68
+ long nr_negative; /* # of unused negative dentries */
69
+ long dummy; /* Reserved for future use */
6970 };
7071 extern struct dentry_stat_t dentry_stat;
7172
....@@ -89,7 +90,7 @@
8990 struct dentry {
9091 /* RCU lookup touched fields */
9192 unsigned int d_flags; /* protected by d_lock */
92
- seqcount_t d_seq; /* per dentry seqlock */
93
+ seqcount_spinlock_t d_seq; /* per dentry seqlock */
9394 struct hlist_bl_node d_hash; /* lookup hash list */
9495 struct dentry *d_parent; /* parent directory */
9596 struct qstr d_name;
....@@ -150,9 +151,8 @@
150151 struct vfsmount *(*d_automount)(struct path *);
151152 int (*d_manage)(const struct path *, bool);
152153 struct dentry *(*d_real)(struct dentry *, const struct inode *);
153
-
154
- ANDROID_KABI_USE(1, void (*d_canonical_path)(const struct path *,
155
- struct path *));
154
+ void (*d_canonical_path)(const struct path *, struct path *);
155
+ ANDROID_KABI_RESERVE(1);
156156 ANDROID_KABI_RESERVE(2);
157157 ANDROID_KABI_RESERVE(3);
158158 ANDROID_KABI_RESERVE(4);
....@@ -160,9 +160,9 @@
160160
161161 /*
162162 * Locking rules for dentry_operations callbacks are to be found in
163
- * Documentation/filesystems/Locking. Keep it updated!
163
+ * Documentation/filesystems/locking.rst. Keep it updated!
164164 *
165
- * FUrther descriptions are found in Documentation/filesystems/vfs.txt.
165
+ * FUrther descriptions are found in Documentation/filesystems/vfs.rst.
166166 * Keep it updated too!
167167 */
168168
....@@ -185,6 +185,8 @@
185185 * typically using d_splice_alias. */
186186
187187 #define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */
188
+
189
+#define DCACHE_DONTCACHE 0x00000080 /* Purge from memory on final dput() */
188190
189191 #define DCACHE_CANT_MOUNT 0x00000100
190192 #define DCACHE_GENOCIDE 0x00000200
....@@ -220,7 +222,7 @@
220222
221223 #define DCACHE_MAY_FREE 0x00800000
222224 #define DCACHE_FALLTHRU 0x01000000 /* Fall through to lower layer */
223
-#define DCACHE_ENCRYPTED_NAME 0x02000000 /* Encrypted name (dir key was unavailable) */
225
+#define DCACHE_NOKEY_NAME 0x02000000 /* Encrypted name encoded without key */
224226 #define DCACHE_OP_REAL 0x04000000
225227
226228 #define DCACHE_PAR_LOOKUP 0x10000000 /* being looked up (with parent locked shared) */
....@@ -244,7 +246,6 @@
244246 /* allocate/de-allocate */
245247 extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
246248 extern struct dentry * d_alloc_anon(struct super_block *);
247
-extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
248249 extern struct dentry * d_alloc_parallel(struct dentry *, const struct qstr *,
249250 wait_queue_head_t *);
250251 extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
....@@ -301,7 +302,6 @@
301302 */
302303 extern __printf(4, 5)
303304 char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
304
-extern char *simple_dname(struct dentry *, char *, int);
305305
306306 extern char *__d_path(const struct path *, const struct path *, char *, int);
307307 extern char *d_absolute_path(const struct path *, char *, int);
....@@ -451,6 +451,11 @@
451451 return d_is_miss(dentry);
452452 }
453453
454
+static inline bool d_flags_negative(unsigned flags)
455
+{
456
+ return (flags & DCACHE_ENTRY_TYPE) == DCACHE_MISS_TYPE;
457
+}
458
+
454459 static inline bool d_is_positive(const struct dentry *dentry)
455460 {
456461 return !d_is_negative(dentry);
....@@ -578,7 +583,7 @@
578583 * If dentry is on a union/overlay, then return the underlying, real dentry.
579584 * Otherwise return the dentry itself.
580585 *
581
- * See also: Documentation/filesystems/vfs.txt
586
+ * See also: Documentation/filesystems/vfs.rst
582587 */
583588 static inline struct dentry *d_real(struct dentry *dentry,
584589 const struct inode *inode)
....@@ -603,7 +608,7 @@
603608 }
604609
605610 struct name_snapshot {
606
- const unsigned char *name;
611
+ struct qstr name;
607612 unsigned char inline_name[DNAME_INLINE_LEN];
608613 };
609614 void take_dentry_name_snapshot(struct name_snapshot *, struct dentry *);