Lines Matching refs:sysnames
439 struct afs_sysnames *sysnames = net->sysnames; in afs_proc_sysname_show() local
442 if (i < sysnames->nr) in afs_proc_sysname_show()
443 seq_printf(m, "%s\n", sysnames->subs[i]); in afs_proc_sysname_show()
455 names = net->sysnames; in afs_proc_sysname_start()
464 struct afs_sysnames *names = net->sysnames; in afs_proc_sysname_next()
492 struct afs_sysnames *sysnames, *kill; in afs_proc_sysname_write() local
498 sysnames = kzalloc(sizeof(*sysnames), GFP_KERNEL); in afs_proc_sysname_write()
499 if (!sysnames) in afs_proc_sysname_write()
501 refcount_set(&sysnames->usage, 1); in afs_proc_sysname_write()
502 kill = sysnames; in afs_proc_sysname_write()
529 if (sysnames->nr >= AFS_NR_SYSNAME) in afs_proc_sysname_write()
541 sysnames->subs[sysnames->nr] = sub; in afs_proc_sysname_write()
542 sysnames->nr++; in afs_proc_sysname_write()
545 if (sysnames->nr == 0) { in afs_proc_sysname_write()
546 sysnames->subs[0] = sysnames->blank; in afs_proc_sysname_write()
547 sysnames->nr++; in afs_proc_sysname_write()
551 kill = net->sysnames; in afs_proc_sysname_write()
552 net->sysnames = sysnames; in afs_proc_sysname_write()
565 void afs_put_sysnames(struct afs_sysnames *sysnames) in afs_put_sysnames() argument
569 if (sysnames && refcount_dec_and_test(&sysnames->usage)) { in afs_put_sysnames()
570 for (i = 0; i < sysnames->nr; i++) in afs_put_sysnames()
571 if (sysnames->subs[i] != afs_init_sysname && in afs_put_sysnames()
572 sysnames->subs[i] != sysnames->blank) in afs_put_sysnames()
573 kfree(sysnames->subs[i]); in afs_put_sysnames()
574 kfree(sysnames); in afs_put_sysnames()