Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  mshv_portid_table.c

  Sprache: C
 

// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/idr.h>
#include <asm/mshyperv.h>

#include "mshv.h"
#include "mshv_root.h"

/*
 * Ports and connections are hypervisor struct used for inter-partition
 * communication. Port represents the source and connection represents
 * the destination. Partitions are responsible for managing the port and
 * connection ids.
 *
 */


#define PORTID_MIN 1
#define PORTID_MAX INT_MAX

static DEFINE_IDR(port_table_idr);

void
mshv_port_table_fini(void)
{
 struct port_table_info *port_info;
 unsigned long i, tmp;

 idr_lock(&port_table_idr);
 if (!idr_is_empty(&port_table_idr)) {
  idr_for_each_entry_ul(&port_table_idr, port_info, tmp, i) {
   port_info = idr_remove(&port_table_idr, i);
   kfree_rcu(port_info, portbl_rcu);
  }
 }
 idr_unlock(&port_table_idr);
}

int
mshv_portid_alloc(struct port_table_info *info)
{
 int ret = 0;

 idr_lock(&port_table_idr);
 ret = idr_alloc(&port_table_idr, info, PORTID_MIN,
   PORTID_MAX, GFP_KERNEL);
 idr_unlock(&port_table_idr);

 return ret;
}

void
mshv_portid_free(int port_id)
{
 struct port_table_info *info;

 idr_lock(&port_table_idr);
 info = idr_remove(&port_table_idr, port_id);
 WARN_ON(!info);
 idr_unlock(&port_table_idr);

 synchronize_rcu();
 kfree(info);
}

int
mshv_portid_lookup(int port_id, struct port_table_info *info)
{
 struct port_table_info *_info;
 int ret = -ENOENT;

 rcu_read_lock();
 _info = idr_find(&port_table_idr, port_id);
 rcu_read_unlock();

 if (_info) {
  *info = *_info;
  ret = 0;
 }

 return ret;
}

Messung V0.5 in Prozent
C=96 H=94 G=94

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-06-07) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002