Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-cgroup.c Create Date:2022-07-28 17:39:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lkg_conf_prep - parse and prepare for per-blkg config update*@blkcg: target block cgroup*@pol: target policy*@input: input string*@ctx: blkg_conf_ctx to be filled* Parse per-blkg config update from @input and initialize @ctx with the* result

Proto:int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, char *input, struct blkg_conf_ctx *ctx)__acquires(rcu) __acquires(&disk->queue->queue_lock)

Type:int

Parameter:

TypeParameterName
struct blkcg *blkcg
const struct blkcg_policy *pol
char *input
struct blkg_conf_ctx *ctx
636  disk = lkg_conf_prep - parse and prepare for per-blkg config update*@inputp: input string pointer* Parse the device node prefix part, MAJ:MIN, of per-blkg config update* from @input and get and return the matching gendisk. *@inputp is
637  If IS_ERR(disk) Then Return PTR_ERR(disk)
640  q = queue
642  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
643  spin_lock_irq( & queue_lock)
645  blkg = Performs queue bypass and policy enabled checks then looks up blkg.
646  If IS_ERR(blkg) Then
647  ret = PTR_ERR(blkg)
648  Go to fail_unlock
651  If blkg Then Go to success
658  When (true) cycle
659  pos = blkcg
663  parent = lkcg_parent - get the parent of a blkcg*@blkcg: blkcg of interest* Return the parent blkcg of @blkcg. Can be called anytime.
665  pos = parent
670  spin_unlock_irq( & queue_lock)
671  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
673  new_blkg = lkg_alloc - allocate a blkg*@blkcg: block cgroup the new blkg is associated with*@q: request_queue the new blkg is associated with*@gfp_mask: allocation mask to use* Allocate a new blkg assocating @blkcg and @q.
675  ret = -ENOMEM
676  Go to fail
679  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
680  spin_lock_irq( & queue_lock)
682  blkg = Performs queue bypass and policy enabled checks then looks up blkg.
683  If IS_ERR(blkg) Then
684  ret = PTR_ERR(blkg)
685  Go to fail_unlock
688  If blkg Then
690  Else
692  If IS_ERR(blkg) Then
693  ret = PTR_ERR(blkg)
694  Go to fail_unlock
698  If pos == blkcg Then Go to success
701  success :
702  disk = disk
703  blkg = blkg
704  body = input
705  Return 0
707  fail_unlock :
708  spin_unlock_irq( & queue_lock)
709  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
710  fail :
711  This is a counterpart of get_disk_and_module() and thus also of* get_gendisk().
718  If ret == -EBUSY Then
719  msleep - sleep safely even with waitqueue interruptions*@msecs: Time in milliseconds to sleep for
720  ret = restart_syscall()
722  Return ret
Caller
NameDescribe
tg_set_conf
tg_set_limit
iolatency_set_limit
ioc_weight_write