Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\rdtgroup.c Create Date:2022-07-28 08:11:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:dtgroup_mode_write - Modify the resource group's mode

Proto:static ssize_t rdtgroup_mode_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

Type:ssize_t

Parameter:

TypeParameterName
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
1180  ret = 0
1183  If nbytes == 0 || buf[nbytes - 1] != '\n' Then Return -EINVAL
1185  buf[nbytes - 1] = '\0'
1187  rdtgrp = rdtgroup_kn_lock_live( published fields )
1188  If Not rdtgrp Then
1189  rdtgroup_kn_unlock( published fields )
1190  Return -ENOENT
1193  rdt_last_cmd_clear()
1195  mode = mode
1197  If Not strcmp(buf, "shareable") && mode == RDT_MODE_SHAREABLE || Not strcmp(buf, "exclusive") && mode == RDT_MODE_EXCLUSIVE || Not strcmp(buf, "pseudo-locksetup") && mode == RDT_MODE_PSEUDO_LOCKSETUP || Not strcmp(buf, "pseudo-locked") && mode == RDT_MODE_PSEUDO_LOCKED Then Go to out
1204  If mode == RDT_MODE_PSEUDO_LOCKED Then
1205  rdt_last_cmd_puts("Cannot change pseudo-locked group\n")
1206  ret = -EINVAL
1207  Go to out
1210  If Not strcmp(buf, "shareable") Then
1211  If mode == RDT_MODE_PSEUDO_LOCKSETUP Then
1213  If ret Then Go to out
1216  mode = RDT_MODE_SHAREABLE
1217  Else if Not strcmp(buf, "exclusive") Then
1219  ret = -EINVAL
1220  Go to out
1222  If mode == RDT_MODE_PSEUDO_LOCKSETUP Then
1224  If ret Then Go to out
1227  mode = RDT_MODE_EXCLUSIVE
1228  Else if Not strcmp(buf, "pseudo-locksetup") Then
1229  ret = dtgroup_locksetup_enter - Resource group enters locksetup mode*@rdtgrp: resource group requested to enter locksetup mode* A resource group enters locksetup mode to reflect that it would be used* to represent a pseudo-locked region and is in the process of
1230  If ret Then Go to out
1232  mode = RDT_MODE_PSEUDO_LOCKSETUP
1233  Else
1234  rdt_last_cmd_puts("Unknown or unsupported mode\n")
1235  ret = -EINVAL
1238  out :
1239  rdtgroup_kn_unlock( published fields )
1240  Return If ret Else nbytes