hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/ceph/cache.c
....@@ -1,26 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Ceph cache definitions.
34 *
45 * Copyright (C) 2013 by Adfin Solutions, Inc. All Rights Reserved.
56 * Written by Milosz Tanski (milosz@adfin.com)
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2
9
- * as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to:
18
- * Free Software Foundation
19
- * 51 Franklin Street, Fifth Floor
20
- * Boston, MA 02111-1301 USA
21
- *
227 */
238
9
+#include <linux/ceph/ceph_debug.h>
10
+
11
+#include <linux/fs_context.h>
2412 #include "super.h"
2513 #include "cache.h"
2614
....@@ -44,7 +32,7 @@
4432 size_t uniq_len;
4533 /* The following members must be last */
4634 struct ceph_fsid fsid;
47
- char uniquifier[0];
35
+ char uniquifier[];
4836 };
4937
5038 static const struct fscache_cookie_def ceph_fscache_fsid_object_def = {
....@@ -62,7 +50,7 @@
6250 fscache_unregister_netfs(&ceph_cache_netfs);
6351 }
6452
65
-int ceph_fscache_register_fs(struct ceph_fs_client* fsc)
53
+int ceph_fscache_register_fs(struct ceph_fs_client* fsc, struct fs_context *fc)
6654 {
6755 const struct ceph_fsid *fsid = &fsc->client->fsid;
6856 const char *fscache_uniq = fsc->mount_options->fscache_uniq;
....@@ -79,8 +67,8 @@
7967 if (uniq_len && memcmp(ent->uniquifier, fscache_uniq, uniq_len))
8068 continue;
8169
82
- pr_err("fscache cookie already registered for fsid %pU\n", fsid);
83
- pr_err(" use fsc=%%s mount option to specify a uniquifier\n");
70
+ errorfc(fc, "fscache cookie already registered for fsid %pU, use fsc=<uniquifier> option",
71
+ fsid);
8472 err = -EBUSY;
8573 goto out_unlock;
8674 }
....@@ -108,7 +96,7 @@
10896 list_add_tail(&ent->list, &ceph_fscache_list);
10997 } else {
11098 kfree(ent);
111
- pr_err("unable to register fscache cookie for fsid %pU\n",
99
+ errorfc(fc, "unable to register fscache cookie for fsid %pU",
112100 fsid);
113101 /* all other fs ignore this error */
114102 }