.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Ceph cache definitions. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2013 by Adfin Solutions, Inc. All Rights Reserved. |
---|
5 | 6 | * 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 | | - * |
---|
22 | 7 | */ |
---|
23 | 8 | |
---|
| 9 | +#include <linux/ceph/ceph_debug.h> |
---|
| 10 | + |
---|
| 11 | +#include <linux/fs_context.h> |
---|
24 | 12 | #include "super.h" |
---|
25 | 13 | #include "cache.h" |
---|
26 | 14 | |
---|
.. | .. |
---|
44 | 32 | size_t uniq_len; |
---|
45 | 33 | /* The following members must be last */ |
---|
46 | 34 | struct ceph_fsid fsid; |
---|
47 | | - char uniquifier[0]; |
---|
| 35 | + char uniquifier[]; |
---|
48 | 36 | }; |
---|
49 | 37 | |
---|
50 | 38 | static const struct fscache_cookie_def ceph_fscache_fsid_object_def = { |
---|
.. | .. |
---|
62 | 50 | fscache_unregister_netfs(&ceph_cache_netfs); |
---|
63 | 51 | } |
---|
64 | 52 | |
---|
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) |
---|
66 | 54 | { |
---|
67 | 55 | const struct ceph_fsid *fsid = &fsc->client->fsid; |
---|
68 | 56 | const char *fscache_uniq = fsc->mount_options->fscache_uniq; |
---|
.. | .. |
---|
79 | 67 | if (uniq_len && memcmp(ent->uniquifier, fscache_uniq, uniq_len)) |
---|
80 | 68 | continue; |
---|
81 | 69 | |
---|
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); |
---|
84 | 72 | err = -EBUSY; |
---|
85 | 73 | goto out_unlock; |
---|
86 | 74 | } |
---|
.. | .. |
---|
108 | 96 | list_add_tail(&ent->list, &ceph_fscache_list); |
---|
109 | 97 | } else { |
---|
110 | 98 | 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", |
---|
112 | 100 | fsid); |
---|
113 | 101 | /* all other fs ignore this error */ |
---|
114 | 102 | } |
---|