cell.c (1758047057dbe329be712a31b79db7151b5871f8) cell.c (523d27cda149cfc8c99159c0f68f690e4d3b9d14)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* AFS cell and server record management
3 *
4 * Copyright (C) 2002, 2017 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 */
7
8#include <linux/slab.h>

--- 666 unchanged lines hidden (view full) ---

675 int ret;
676
677 if (!cell->anonymous_key) {
678 ret = afs_alloc_anon_key(cell);
679 if (ret < 0)
680 return ret;
681 }
682
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* AFS cell and server record management
3 *
4 * Copyright (C) 2002, 2017 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 */
7
8#include <linux/slab.h>

--- 666 unchanged lines hidden (view full) ---

675 int ret;
676
677 if (!cell->anonymous_key) {
678 ret = afs_alloc_anon_key(cell);
679 if (ret < 0)
680 return ret;
681 }
682
683#ifdef CONFIG_AFS_FSCACHE
684 cell->cache = fscache_acquire_cookie(afs_cache_netfs.primary_index,
685 &afs_cell_cache_index_def,
686 cell->name, strlen(cell->name),
687 NULL, 0,
688 cell, 0, true);
689#endif
690 ret = afs_proc_cell_setup(cell);
691 if (ret < 0)
692 return ret;
693
694 mutex_lock(&net->proc_cells_lock);
695 for (p = &net->proc_cells.first; *p; p = &(*p)->next) {
696 pcell = hlist_entry(*p, struct afs_cell, proc_link);
697 if (strcmp(cell->name, pcell->name) < 0)

--- 20 unchanged lines hidden (view full) ---

718
719 afs_proc_cell_remove(cell);
720
721 mutex_lock(&net->proc_cells_lock);
722 hlist_del_rcu(&cell->proc_link);
723 afs_dynroot_rmdir(net, cell);
724 mutex_unlock(&net->proc_cells_lock);
725
683 ret = afs_proc_cell_setup(cell);
684 if (ret < 0)
685 return ret;
686
687 mutex_lock(&net->proc_cells_lock);
688 for (p = &net->proc_cells.first; *p; p = &(*p)->next) {
689 pcell = hlist_entry(*p, struct afs_cell, proc_link);
690 if (strcmp(cell->name, pcell->name) < 0)

--- 20 unchanged lines hidden (view full) ---

711
712 afs_proc_cell_remove(cell);
713
714 mutex_lock(&net->proc_cells_lock);
715 hlist_del_rcu(&cell->proc_link);
716 afs_dynroot_rmdir(net, cell);
717 mutex_unlock(&net->proc_cells_lock);
718
726#ifdef CONFIG_AFS_FSCACHE
727 fscache_relinquish_cookie(cell->cache, NULL, false);
728 cell->cache = NULL;
729#endif
730
731 _leave("");
732}
733
734/*
735 * Manage a cell record, initialising and destroying it, maintaining its DNS
736 * records.
737 */
738static void afs_manage_cell(struct afs_cell *cell)

--- 229 unchanged lines hidden ---
719 _leave("");
720}
721
722/*
723 * Manage a cell record, initialising and destroying it, maintaining its DNS
724 * records.
725 */
726static void afs_manage_cell(struct afs_cell *cell)

--- 229 unchanged lines hidden ---