Skip to content

Commit 469c82b

Browse files
committed
afs: Drop the net parameter from afs_unuse_cell()
Remove the redundant net parameter to afs_unuse_cell() as cell->net can be used instead. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20250224234154.2014840-12-dhowells@redhat.com/ # v1 Link: https://lore.kernel.org/r/20250310094206.801057-8-dhowells@redhat.com/ # v4
1 parent 92c4815 commit 469c82b

8 files changed

Lines changed: 18 additions & 18 deletions

File tree

fs/afs/cell.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ struct afs_cell *afs_lookup_cell(struct afs_net *net,
339339
goto wait_for_cell;
340340
goto error_noput;
341341
error:
342-
afs_unuse_cell(net, cell, afs_cell_trace_unuse_lookup);
342+
afs_unuse_cell(cell, afs_cell_trace_unuse_lookup_error);
343343
error_noput:
344344
_leave(" = %d [error]", ret);
345345
return ERR_PTR(ret);
@@ -402,7 +402,7 @@ int afs_cell_init(struct afs_net *net, const char *rootcell)
402402
lockdep_is_held(&net->cells_lock));
403403
up_write(&net->cells_lock);
404404

405-
afs_unuse_cell(net, old_root, afs_cell_trace_unuse_ws);
405+
afs_unuse_cell(old_root, afs_cell_trace_unuse_ws);
406406
_leave(" = 0");
407407
return 0;
408408
}
@@ -520,7 +520,7 @@ static void afs_cell_destroy(struct rcu_head *rcu)
520520
trace_afs_cell(cell->debug_id, r, atomic_read(&cell->active), afs_cell_trace_free);
521521

522522
afs_put_vlserverlist(net, rcu_access_pointer(cell->vl_servers));
523-
afs_unuse_cell(net, cell->alias_of, afs_cell_trace_unuse_alias);
523+
afs_unuse_cell(cell->alias_of, afs_cell_trace_unuse_alias);
524524
key_put(cell->anonymous_key);
525525
idr_remove(&net->cells_dyn_ino, cell->dynroot_ino);
526526
kfree(cell->name - 1);
@@ -608,7 +608,7 @@ struct afs_cell *afs_use_cell(struct afs_cell *cell, enum afs_cell_trace reason)
608608
* Record a cell becoming less active. When the active counter reaches 1, it
609609
* is scheduled for destruction, but may get reactivated.
610610
*/
611-
void afs_unuse_cell(struct afs_net *net, struct afs_cell *cell, enum afs_cell_trace reason)
611+
void afs_unuse_cell(struct afs_cell *cell, enum afs_cell_trace reason)
612612
{
613613
unsigned int debug_id;
614614
time64_t now, expire_delay;
@@ -632,7 +632,7 @@ void afs_unuse_cell(struct afs_net *net, struct afs_cell *cell, enum afs_cell_tr
632632
WARN_ON(a == 0);
633633
if (a == 1)
634634
/* 'cell' may now be garbage collected. */
635-
afs_set_cell_timer(net, expire_delay);
635+
afs_set_cell_timer(cell->net, expire_delay);
636636
}
637637

638638
/*
@@ -957,7 +957,7 @@ void afs_cell_purge(struct afs_net *net)
957957
ws = rcu_replace_pointer(net->ws_cell, NULL,
958958
lockdep_is_held(&net->cells_lock));
959959
up_write(&net->cells_lock);
960-
afs_unuse_cell(net, ws, afs_cell_trace_unuse_ws);
960+
afs_unuse_cell(ws, afs_cell_trace_unuse_ws);
961961

962962
_debug("del timer");
963963
if (del_timer_sync(&net->cells_timer))

fs/afs/dynroot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static struct dentry *afs_dynroot_lookup_cell(struct inode *dir, struct dentry *
125125
return d_splice_alias(inode, dentry);
126126

127127
out:
128-
afs_unuse_cell(cell->net, cell, afs_cell_trace_unuse_lookup_dynroot);
128+
afs_unuse_cell(cell, afs_cell_trace_unuse_lookup_dynroot);
129129
out_no_cell:
130130
if (!inode)
131131
return d_splice_alias(inode, dentry);
@@ -167,7 +167,7 @@ static void afs_dynroot_d_release(struct dentry *dentry)
167167
{
168168
struct afs_cell *cell = dentry->d_fsdata;
169169

170-
afs_unuse_cell(cell->net, cell, afs_cell_trace_unuse_dynroot_mntpt);
170+
afs_unuse_cell(cell, afs_cell_trace_unuse_dynroot_mntpt);
171171
}
172172

173173
/*

fs/afs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ struct afs_cell *afs_lookup_cell(struct afs_net *net,
10511051
const char *vllist, bool excl,
10521052
enum afs_cell_trace trace);
10531053
extern struct afs_cell *afs_use_cell(struct afs_cell *, enum afs_cell_trace);
1054-
extern void afs_unuse_cell(struct afs_net *, struct afs_cell *, enum afs_cell_trace);
1054+
void afs_unuse_cell(struct afs_cell *cell, enum afs_cell_trace reason);
10551055
extern struct afs_cell *afs_get_cell(struct afs_cell *, enum afs_cell_trace);
10561056
extern void afs_see_cell(struct afs_cell *, enum afs_cell_trace);
10571057
extern void afs_put_cell(struct afs_cell *, enum afs_cell_trace);

fs/afs/mntpt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int afs_mntpt_set_params(struct fs_context *fc, struct dentry *mntpt)
8787
ctx->force = true;
8888
}
8989
if (ctx->cell) {
90-
afs_unuse_cell(ctx->net, ctx->cell, afs_cell_trace_unuse_mntpt);
90+
afs_unuse_cell(ctx->cell, afs_cell_trace_unuse_mntpt);
9191
ctx->cell = NULL;
9292
}
9393
if (test_bit(AFS_VNODE_PSEUDODIR, &vnode->flags)) {

fs/afs/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int afs_proc_cells_write(struct file *file, char *buf, size_t size)
130130
}
131131

132132
if (test_and_set_bit(AFS_CELL_FL_NO_GC, &cell->flags))
133-
afs_unuse_cell(net, cell, afs_cell_trace_unuse_no_pin);
133+
afs_unuse_cell(cell, afs_cell_trace_unuse_no_pin);
134134
} else {
135135
goto inval;
136136
}

fs/afs/super.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static int afs_parse_source(struct fs_context *fc, struct fs_parameter *param)
297297
cellnamesz, cellnamesz, cellname ?: "");
298298
return PTR_ERR(cell);
299299
}
300-
afs_unuse_cell(ctx->net, ctx->cell, afs_cell_trace_unuse_parse);
300+
afs_unuse_cell(ctx->cell, afs_cell_trace_unuse_parse);
301301
afs_see_cell(cell, afs_cell_trace_see_source);
302302
ctx->cell = cell;
303303
}
@@ -394,7 +394,7 @@ static int afs_validate_fc(struct fs_context *fc)
394394
ctx->key = NULL;
395395
cell = afs_use_cell(ctx->cell->alias_of,
396396
afs_cell_trace_use_fc_alias);
397-
afs_unuse_cell(ctx->net, ctx->cell, afs_cell_trace_unuse_fc);
397+
afs_unuse_cell(ctx->cell, afs_cell_trace_unuse_fc);
398398
ctx->cell = cell;
399399
goto reget_key;
400400
}
@@ -520,9 +520,8 @@ static struct afs_super_info *afs_alloc_sbi(struct fs_context *fc)
520520
static void afs_destroy_sbi(struct afs_super_info *as)
521521
{
522522
if (as) {
523-
struct afs_net *net = afs_net(as->net_ns);
524523
afs_put_volume(as->volume, afs_volume_trace_put_destroy_sbi);
525-
afs_unuse_cell(net, as->cell, afs_cell_trace_unuse_sbi);
524+
afs_unuse_cell(as->cell, afs_cell_trace_unuse_sbi);
526525
put_net(as->net_ns);
527526
kfree(as);
528527
}
@@ -605,7 +604,7 @@ static void afs_free_fc(struct fs_context *fc)
605604

606605
afs_destroy_sbi(fc->s_fs_info);
607606
afs_put_volume(ctx->volume, afs_volume_trace_put_free_fc);
608-
afs_unuse_cell(ctx->net, ctx->cell, afs_cell_trace_unuse_fc);
607+
afs_unuse_cell(ctx->cell, afs_cell_trace_unuse_fc);
609608
key_put(ctx->key);
610609
kfree(ctx);
611610
}

fs/afs/vl_alias.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ static int afs_query_for_alias(struct afs_cell *cell, struct key *key)
205205
goto is_alias;
206206

207207
if (mutex_lock_interruptible(&cell->net->proc_cells_lock) < 0) {
208-
afs_unuse_cell(cell->net, p, afs_cell_trace_unuse_check_alias);
208+
afs_unuse_cell(p, afs_cell_trace_unuse_check_alias);
209209
return -ERESTARTSYS;
210210
}
211211

212-
afs_unuse_cell(cell->net, p, afs_cell_trace_unuse_check_alias);
212+
afs_unuse_cell(p, afs_cell_trace_unuse_check_alias);
213213
}
214214

215215
mutex_unlock(&cell->net->proc_cells_lock);

include/trace/events/afs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ enum yfs_cm_operation {
197197
EM(afs_cell_trace_unuse_fc, "UNU fc ") \
198198
EM(afs_cell_trace_unuse_lookup, "UNU lookup") \
199199
EM(afs_cell_trace_unuse_lookup_dynroot, "UNU lu-dyn") \
200+
EM(afs_cell_trace_unuse_lookup_error, "UNU lu-err") \
200201
EM(afs_cell_trace_unuse_mntpt, "UNU mntpt ") \
201202
EM(afs_cell_trace_unuse_no_pin, "UNU no-pin") \
202203
EM(afs_cell_trace_unuse_parse, "UNU parse ") \

0 commit comments

Comments
 (0)