+
     Gi  c                   s    ^ RI Ht ^RIHt ^RI5 ^ RIHtHt ^ RIt	^ RI
Ht ^ RIt]	P                  P                  4       t]! 4       t ! R R]P"                  4      tR# )i    N)base)Z*)PopenPIPE)commandsc                   s   a  ] tR t^t o Rt]R 4       tR t]R 4       tR t	R t
R tR tR	 tR
 t]! RRR7      R 4       tRtV tR# )MountsPlugina7  
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           
     sT   / pRp\        . RO\        \        RRR7      P                  4       w  r4VP                  4        Uu. uF  qUP	                  4       NK  	  up F  p\        V4      ^8  d   K  VR,          w  rxp	\        V4      ^8  d
   V^,          MRp
\        V4      ^8  d
   V^,          MRpVR8X  d   T	pKb  VR8X  g   VR9  d   Kr  Ve   VR8X  d   K  VP                  VR\        4       R	V	R
V
/4       W,          R,          P                  V4       K  	  Wn	        R# u upi )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.
NT)stdoutstderrZ	close_fdsZuniversal_newlines:Ni   NZdiskZ1z[SWAP]disksdevice_name
filesystem)Zlsblkz-rnozTYPE,RM,KNAME,FSTYPE,MOUNTPOINT)ZpartZlvm)
r   r   ZcommunicateZ
splitlinessplitZlenZ
setdefaultsetZadd_mountpoint_topology)ZclsZmountpoint_topologyZcurrent_diskr   r   linecolumnsZdevice_typeZdevice_removabler   r	   
mountpoints   &           @/usr/lib/python3.14/site-packages/tuned/plugins/plugin_mounts.py_generate_mountpoint_topologyZ*MountsPlugin._generate_mountpoint_topology   s#    , '  +{} & ,2+<+<+>?+>4**,+>?g	'lQ07-;+!'lQ.
D:!'lQ.
D:VL #O!CJ(2!!*w}k[gis.tu"7+//=' @* 1+ @s   D%c                s    V P                  4        R V n        \        V P                  P	                  4       4      V n        \        4       V n        R# )TN)r   _devices_supportedr   r   Zkeys_free_devices_assigned_devicesself   &r   _init_devicesZMountsPlugin._init_devices:   s<    $$& $44499;<$5$    c                s
    R R/# )disable_barriersN r   r   r   _get_config_optionsZ MountsPlugin._get_config_options@   s     t
 r   c                s"    R Vn         RVn        R# )FTN)Z_has_dynamic_tuningZ_has_static_tuningr   instance   &&r   _instance_initZMountsPlugin._instance_initF   s    !&( $(r   c                s    R # )Nr   r   r   r   _instance_cleanupZMountsPlugin._instance_cleanupJ   s    r   c                s    \         P                   ! RV,          4      pV F&  p\        P                  V4      P                  4       u # 	  R# )zR
Get device cache type. This will work only for devices on SCSI kernel subsystem.
z+/sys/block/%s/device/scsi_disk/*/cache_typeN)globcmdZ	read_fileZstrip)r   deviceZsource_filenamesZsource_filenames   &&  r   _get_device_cache_typeZ#MountsPlugin._get_device_cache_typeM   s>     YYLvUV)o
--
(
.
.
00 *	r   c                sz    V P                   V,          R,           F  pV P                  V4      R8X  g   K   R# 	  R# )zn
Checks if the device has 'write back' cache. If the cache type cannot be determined, asume some other cache.
r   z
write backTF)r   r%   )r   r   r$   s   && r   _mountpoint_has_writeback_cacheZ,MountsPlugin._mountpoint_has_writeback_cacheV   s<     ))*5g>>f
!!&)\9 ? 
r   c                s   \        R4      ;_uu_ 4       pV FC  pVP                  4       pV^ ,          ^ ,          R8w  d   K*  V^,          V8X  g   K:  V^,          p M	   RRR4       R#  RRR4       XP                  R4      pV F9  pVP                  R4      w  rp
VR8X  g   VR8X  d   V
R8X  d    R	# VR8X  g   K8   R
# 	  R
#   + '       g   i     Lb; i)zL
Checks if a given mountpoint is mounted with barriers enabled or disabled.
z/proc/mountsZ/NZ,Z=Z	nobarrierZbarrierZ0FT)Zopenr
   	partition)r   r   Zmounts_filer   r   Zoption_listoptionsZoptionZnameZsepvalues   &&         r   _mountpoint_has_barriersZ%MountsPlugin._mountpoint_has_barriers_   s     N{tjjlGqz!}qzZ1:[
      c"'f((-Du
kdi/ESL	  / s   8CCC	c                sJ    RVRRV,          .p\         P                  V4       R# )z
Remounts partition.
z/usr/bin/mountz-oz
remount,%sN)r#   Zexecute)r   r'   r(   Zremount_commands   &&& r   _remount_partitionZMountsPlugin._remount_partition|   s#     &y$w8NO/++or   r   T)Z
per_devicec                sH   V P                  R VR7      p\        V4      P                  4       R8H  pT;'       g    V P                  V4      pV'       Ed[   V'       g   R# Rp	V P                  V,          R,          P                  R4      '       g   Rp	MV'       g   V P                  V4      '       d   Rp	MV P                  V4      p
V
f   Rp	MrV
R	8X  d8   V'       d-   \        P                  \        P                  V,          4       R
# Rp	M4V'       d-   \        P                  \        P                  V,          4       R	# V	e!   \        P                  RV: RV	: R24       R# V P                  P                  VX
4       \        P                  RV,          4       V P!                  VR4       R# V'       d   R# V P                  P#                  V4      p
V
f   R# \        P                  RV,          4       V P!                  VR4       V P                  P%                  V4       R# )r   )Zcommand_namer   forceNr	   Zextzfilesystem not supportedzdevice uses write back cachezunknown current settingFTzbarriers already disabledznot disabling barriers on 'z' (Z)zdisabling barriers on '%s'z	barrier=0zenabling barriers on '%s'z	barrier=1)Z_storage_keyZstrZlowerZ_option_boolr   Z
startswithr&   r*   logZinfoconstsZSTR_VERIFY_PROFILE_OKZerrorZSTR_VERIFY_PROFILE_FAILZ_storager   r+   getZunset)r   Zstartr)   r   ZverifyZignore_missingr   Zstorage_keyr,   Zreject_reasonZoriginal_values   &&&&&&&    r   _disable_barriersZMountsPlugin._disable_barriers   s   !!% " + e*



'%

+
+4$$U+%
U
=

#
#J
/
=
H
H
O
O.Md:::FF2M22:>N.]	5	 	hhv++j891m	YYv--
:;HHj-PQ==[.188(:56:{3 
 MM%%k2>88'*45:{3=={#	r   )r   r   r   N)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Zclassmethodr   r   r   r    r!   r%   r&   r*   r+   Zcommand_customr0   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      sr      !1 !1F!  
%: #51 61r   r   )Ztuned.constsr.   Z r    Z
decoratorsZ
subprocessr   r   Z
tuned.logsZtunedZtuned.utils.commandsr   r"   Zlogsr/   r-   r#   ZPluginr   r   r   r   <module>r1      sC       !  ) jjnnji4;; ir   