hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/fs/fscache/object.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* FS-Cache object state machine handler
23 *
34 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
45 * Written by David Howells (dhowells@redhat.com)
56 *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
10
- *
11
- * See Documentation/filesystems/caching/object.txt for a description of the
7
+ * See Documentation/filesystems/caching/object.rst for a description of the
128 * object state machine and the in-kernel representations.
139 */
1410
....@@ -299,7 +295,7 @@
299295 *
300296 * Initialise a cache object description to its basic values.
301297 *
302
- * See Documentation/filesystems/caching/backend-api.txt for a complete
298
+ * See Documentation/filesystems/caching/backend-api.rst for a complete
303299 * description.
304300 */
305301 void fscache_object_init(struct fscache_object *object,
....@@ -811,6 +807,8 @@
811807 }
812808 EXPORT_SYMBOL(fscache_object_destroy);
813809
810
+static DECLARE_WAIT_QUEUE_HEAD(fscache_object_cong_wait);
811
+
814812 /*
815813 * enqueue an object for metadata-type processing
816814 */
....@@ -819,16 +817,12 @@
819817 _enter("{OBJ%x}", object->debug_id);
820818
821819 if (fscache_get_object(object, fscache_obj_get_queue) >= 0) {
822
- wait_queue_head_t *cong_wq =
823
- &get_cpu_var(fscache_object_cong_wait);
824820
825821 if (queue_work(fscache_object_wq, &object->work)) {
826822 if (fscache_object_congested())
827
- wake_up(cong_wq);
823
+ wake_up(&fscache_object_cong_wait);
828824 } else
829825 fscache_put_object(object, fscache_obj_put_queue);
830
-
831
- put_cpu_var(fscache_object_cong_wait);
832826 }
833827 }
834828
....@@ -846,16 +840,15 @@
846840 */
847841 bool fscache_object_sleep_till_congested(signed long *timeoutp)
848842 {
849
- wait_queue_head_t *cong_wq = this_cpu_ptr(&fscache_object_cong_wait);
850843 DEFINE_WAIT(wait);
851844
852845 if (fscache_object_congested())
853846 return true;
854847
855
- add_wait_queue_exclusive(cong_wq, &wait);
848
+ add_wait_queue_exclusive(&fscache_object_cong_wait, &wait);
856849 if (!fscache_object_congested())
857850 *timeoutp = schedule_timeout(*timeoutp);
858
- finish_wait(cong_wq, &wait);
851
+ finish_wait(&fscache_object_cong_wait, &wait);
859852
860853 return fscache_object_congested();
861854 }