403Webshell
Server IP : 158.178.228.73  /  Your IP : 80.80.80.153
Web Server : Apache/2.4.37 (Oracle Linux Server) OpenSSL/1.1.1k
System : Linux ust-wp1-prod 5.15.0-308.179.6.el8uek.x86_64 #2 SMP Wed Apr 23 10:46:57 PDT 2025 x86_64
User : tomasFtp ( 1007)
PHP Version : 8.4.8
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/thread-self/root/proc/self/root/proc/thread-self/root/usr/sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/proc/self/root/proc/thread-self/root/usr/sbin/mkfs.xmem
#!/bin/bash

# mkfs.xfs wrapper for pmem devices
# Usage: mkfs.xmem /dev/pmemX

# Map a block device to its sysfs counterpart
find_sysfs_dev() {
	local dev="$1"

	test -b "${dev}" || return
	local major="$(stat -c '0x%t' "${dev}")"
	local minor="$(stat -c '0x%T' "${dev}")"
	local dev_string="$((major)):$((minor))"

	for sysfs_dev in /sys/block/*; do
		if grep -q "^${dev_string}$" "${sysfs_dev}/dev"; then
			echo "${sysfs_dev}"
			break
		fi
	done
}

# Look up the underlying alignment of a pmem device
find_pmem_alignment() {
	local dev="$1"
	local sysfs_dev="$(find_sysfs_dev "${dev}")"

	if [ ! -e "${sysfs_dev}" ] ||
	   [ ! -r "${sysfs_dev}/device/devtype" ] ||
	   [ "$(cat "${sysfs_dev}/device/devtype")" != "nd_pfn" ] ||
	   [ ! -e "${sysfs_dev}/device/align" ]; then
		return
	fi

	cat "${sysfs_dev}/device/align"
}

# Determine the data block size of a potential filesystem
fs_data_block_size() {
	mkfs.xfs -f -N "$@" 2>/dev/null | grep 'data.*bsize=' | \
		sed -e 's/^.*bsize=\([0-9]*\).*/\1/g'
}

if [ $# -ne 1 ] || [ ! -b "$1" ]; then
	echo "Usage: $0 pmem_device"
	exit 1
fi
dev="$1"

# If we found a pmem block device, look up its alignment and compute
# appropriate allocation hints
pmem_align="$(find_pmem_alignment "${dev}")"
if [ -z "${pmem_align}" ]; then
	echo "${dev}: Not a pmem device."
	exit 2
fi

blocksz="$(fs_data_block_size "$@")"
if [ -z "${blocksz}" ]; then
	echo "${dev}: Unable to determine potential filesystem blocksize."
	exit 3
fi

mkfs_args+=('-m' 'crc=1,reflink=0' '-f')

if [ "${pmem_align}" -gt "${blocksz}" ]; then
	mkfs_args+=('-d')
	mkfs_args+=("su=${pmem_align},sw=1,extszinherit=$((pmem_align / blocksz))")
fi

trap '' ABRT
for agcount in $(seq 2 $(getconf _NPROCESSORS_ONLN)) x; do
	mkfs.xfs -d "agcount=${agcount}" "${mkfs_args[@]}" -N "$@" \
		> /dev/null 2>&1 && break
done
if [ "${agcount}" != "x" ]; then
	mkfs_args+=('-d' "agcount=${agcount}")
fi

trap - ABRT
exec mkfs.xfs "${mkfs_args[@]}" "$@"

Youez - 2016 - github.com/yon3zu
LinuXploit