Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\relay.c Create Date:2022-07-28 11:47:09
Last Modify:2020-03-17 19:20:22 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lay_late_setup_files - triggers file creation*@chan: channel to operate on*@base_filename: base name of files to create*@parent: dentry of parent directory, %NULL for root directory* Returns 0 if successful, non-zero otherwise

Proto:int relay_late_setup_files(struct rchan *chan, const char *base_filename, struct dentry *parent)

Type:int

Parameter:

TypeParameterName
struct rchan *chan
const char *base_filename
struct dentry *parent
653  err = 0
660  If Not chan || Not base_filename Then Return -EINVAL
663  Copy a NUL terminated string into a sized buffer
665  mutex_lock( & list of open channels, for cpu hotplug )
667  If Value for the false possibility is greater at compile time( has a filename associated? ) Then
668  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
669  Return -EEXIST
671  has a filename associated? = 1
672  parent dentry passed to open = parent
674  If One global buffer ? Then
675  err = -EINVAL
676  buf = per_cpu_ptr( per-cpu channel buffers , 0)
677  If Not WARN_ON_ONCE(!buf) Then
679  If dentry && Not WARN_ON_ONCE(! One global buffer ? ) Then
681  err = 0
684  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
685  Return err
688  curr_cpu = get_cpu()
694  for_each_online_cpu(i)
695  buf = per_cpu_ptr( per-cpu channel buffers , i)
697  WARN_ONCE(1, r conditions "CPU has no buffer!\n")
698  err = -EINVAL
699  Break
702  dentry = relay_create_buf_file(chan, buf, i)
704  err = -EINVAL
705  Break
708  If curr_cpu == i Then
712  Else
713  buf = buf
714  dentry = dentry
715  smp_mb()
721  If Value for the false possibility is greater at compile time(err) Then Break
724  put_cpu()
725  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
727  Return err