| Server IP : 185.143.234.130 / Your IP : 185.215.232.195 Web Server : LiteSpeed System : Linux jambul.7ho.st 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : renecafe ( 1327) PHP Version : 8.1.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3.9/site-packages/tuned/plugins/__pycache__/ |
Upload File : |
a
,�g� � @ sr d dl mZ ddlmZ ddlT d dlmZmZ d dlZ d dl
mZ d dlZe j
�� Ze� ZG dd� dej�ZdS ) � N� )�base)�*)�Popen�PIPE)�commandsc @ st e Zd ZdZedd� �Zdd� Zedd� �Zdd � Zd
d� Z dd
� Z
dd� Zdd� Zdd� Z
eddd�dd� �ZdS )�MountsPlugina=
Enables or disables barriers for mounts according to the value of the
boolean option [option]`disable_barriers`. The option additionally allows
the special value `force`, which disables barriers even on mountpoints with
write back caches.
NOTE: Only extended file systems (ext) are supported by this plug-in.
c C s� i }d}t g d�ttddd��� \}}dd� |�� D �D ]�}t|�dk rJq8|dd� \}}}t|�dkrp|d nd} t|�dkr�|d nd}
|d kr�|}q8|d
ks8|dvr�q8|
du s8|
dkr�q8|�|
t� || d
�� ||
d �|� q8|| _dS )z�
Gets the information about disks, partitions and mountpoints. Stores information about used filesystem and
creates a list of all underlying devices (in case of LVM) for each mountpoint.
N)Zlsblkz-rnozTYPE,RM,KNAME,FSTYPE,MOUNTPOINTT)�stdout�stderrZ close_fdsZuniversal_newlinesc S s g | ]}|� � �qS � )�split)�.0�liner r �?/usr/lib/python3.9/site-packages/tuned/plugins/plugin_mounts.py�
<listcomp># � z>MountsPlugin._generate_mountpoint_topology.<locals>.<listcomp>� � Zdisk�1)�partZlvmz[SWAP])�disks�device_name�
filesystemr ) r r Zcommunicate�
splitlines�len�
setdefault�set�add�_mountpoint_topology)�clsZmountpoint_topologyZcurrent_diskr r
�columnsZdevice_typeZdevice_removabler r �
mountpointr r r �_generate_mountpoint_topology s, �z*MountsPlugin._generate_mountpoint_topologyc C s* | � � d| _t| j�� �| _t� | _d S )NT)r"