aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-12 10:55:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-03 10:57:18 -0400
commit1a829ff2a6c37187ff8020488e84ec392cb94854 (patch)
treecb687c737aca3429f03bfb08b39043943bc9d9d0 /fs/ceph
parent0a0762c6c604bb0ce8afe4ee052514e0208152a0 (diff)
ceph: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. This cleanup allows the return value of the functions to be made void, as no logic should care if these files succeed or not. Cc: "Yan, Zheng" <zyan@redhat.com> Cc: Sage Weil <sage@redhat.com> Cc: Ilya Dryomov <idryomov@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: ceph-devel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20190612145538.GA18772@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/debugfs.c24
-rw-r--r--fs/ceph/super.c4
-rw-r--r--fs/ceph/super.h2
3 files changed, 4 insertions, 26 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index b3fc5fe26a1a..83cd41fa2b01 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -245,21 +245,17 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
245 debugfs_remove(fsc->debugfs_mdsc); 245 debugfs_remove(fsc->debugfs_mdsc);
246} 246}
247 247
248int ceph_fs_debugfs_init(struct ceph_fs_client *fsc) 248void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
249{ 249{
250 char name[100]; 250 char name[100];
251 int err = -ENOMEM;
252 251
253 dout("ceph_fs_debugfs_init\n"); 252 dout("ceph_fs_debugfs_init\n");
254 BUG_ON(!fsc->client->debugfs_dir);
255 fsc->debugfs_congestion_kb = 253 fsc->debugfs_congestion_kb =
256 debugfs_create_file("writeback_congestion_kb", 254 debugfs_create_file("writeback_congestion_kb",
257 0600, 255 0600,
258 fsc->client->debugfs_dir, 256 fsc->client->debugfs_dir,
259 fsc, 257 fsc,
260 &congestion_kb_fops); 258 &congestion_kb_fops);
261 if (!fsc->debugfs_congestion_kb)
262 goto out;
263 259
264 snprintf(name, sizeof(name), "../../bdi/%s", 260 snprintf(name, sizeof(name), "../../bdi/%s",
265 dev_name(fsc->sb->s_bdi->dev)); 261 dev_name(fsc->sb->s_bdi->dev));
@@ -267,52 +263,36 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
267 debugfs_create_symlink("bdi", 263 debugfs_create_symlink("bdi",
268 fsc->client->debugfs_dir, 264 fsc->client->debugfs_dir,
269 name); 265 name);
270 if (!fsc->debugfs_bdi)
271 goto out;
272 266
273 fsc->debugfs_mdsmap = debugfs_create_file("mdsmap", 267 fsc->debugfs_mdsmap = debugfs_create_file("mdsmap",
274 0400, 268 0400,
275 fsc->client->debugfs_dir, 269 fsc->client->debugfs_dir,
276 fsc, 270 fsc,
277 &mdsmap_show_fops); 271 &mdsmap_show_fops);
278 if (!fsc->debugfs_mdsmap)
279 goto out;
280 272
281 fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions", 273 fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
282 0400, 274 0400,
283 fsc->client->debugfs_dir, 275 fsc->client->debugfs_dir,
284 fsc, 276 fsc,
285 &mds_sessions_show_fops); 277 &mds_sessions_show_fops);
286 if (!fsc->debugfs_mds_sessions)
287 goto out;
288 278
289 fsc->debugfs_mdsc = debugfs_create_file("mdsc", 279 fsc->debugfs_mdsc = debugfs_create_file("mdsc",
290 0400, 280 0400,
291 fsc->client->debugfs_dir, 281 fsc->client->debugfs_dir,
292 fsc, 282 fsc,
293 &mdsc_show_fops); 283 &mdsc_show_fops);
294 if (!fsc->debugfs_mdsc)
295 goto out;
296 284
297 fsc->debugfs_caps = debugfs_create_file("caps", 285 fsc->debugfs_caps = debugfs_create_file("caps",
298 0400, 286 0400,
299 fsc->client->debugfs_dir, 287 fsc->client->debugfs_dir,
300 fsc, 288 fsc,
301 &caps_show_fops); 289 &caps_show_fops);
302 if (!fsc->debugfs_caps)
303 goto out;
304
305 return 0;
306
307out:
308 ceph_fs_debugfs_cleanup(fsc);
309 return err;
310} 290}
311 291
312 292
313#else /* CONFIG_DEBUG_FS */ 293#else /* CONFIG_DEBUG_FS */
314 294
315int ceph_fs_debugfs_init(struct ceph_fs_client *fsc) 295void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
316{ 296{
317 return 0; 297 return 0;
318} 298}
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 01be7c1bc4c6..273c94b61a3d 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -951,9 +951,7 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
951 dout("mount opening path %s\n", path); 951 dout("mount opening path %s\n", path);
952 } 952 }
953 953
954 err = ceph_fs_debugfs_init(fsc); 954 ceph_fs_debugfs_init(fsc);
955 if (err < 0)
956 goto out;
957 955
958 root = open_root_dentry(fsc, path, started); 956 root = open_root_dentry(fsc, path, started);
959 if (IS_ERR(root)) { 957 if (IS_ERR(root)) {
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 6edab9a750f8..ac1e17853278 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -1099,7 +1099,7 @@ extern int ceph_locks_to_pagelist(struct ceph_filelock *flocks,
1099 int num_fcntl_locks, int num_flock_locks); 1099 int num_fcntl_locks, int num_flock_locks);
1100 1100
1101/* debugfs.c */ 1101/* debugfs.c */
1102extern int ceph_fs_debugfs_init(struct ceph_fs_client *client); 1102extern void ceph_fs_debugfs_init(struct ceph_fs_client *client);
1103extern void ceph_fs_debugfs_cleanup(struct ceph_fs_client *client); 1103extern void ceph_fs_debugfs_cleanup(struct ceph_fs_client *client);
1104 1104
1105/* quota.c */ 1105/* quota.c */