函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\acct.c Create Date:2022-07-27 12:02:10
Last Modify:2020-03-17 15:14:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:acct_on

函数原型:static int acct_on(struct filename *pathname)

返回类型:int

参数:

类型参数名称
struct filename *pathname
197  ns等于取进程的空间
202  acct等于分配内存并置零
203  如果非acct则返回:负ENOMEM
207  file等于file_open_name(pathname, O_WRONLY | O_APPEND | O_LARGEFILE, 0)
208  如果是错误
209  kfree(acct)
210  返回:错误
213  如果非S_ISREG(i_mode)则
214  kfree(acct)
215  "id" is the POSIX thread ID. We use the* files pointer for this..
216  返回:负EACCES
219  如果非f_mode按位与Has write method(s) 的值则
220  kfree(acct)
221  "id" is the POSIX thread ID. We use the* files pointer for this..
222  返回:负EIO
224  internal等于mnt_clone_internal( & f_path)
225  如果是错误
226  kfree(acct)
227  "id" is the POSIX thread ID. We use the* files pointer for this..
228  返回:错误
230  err等于__mnt_want_write(internal)
231  如果err
232  mntput(internal)
233  kfree(acct)
234  "id" is the POSIX thread ID. We use the* files pointer for this..
235  返回:err
237  mnt等于mnt
238  mnt等于internal
240  atomic_long_set( & count, 1)
241  init_fs_pin( & pin, acct_pin_kill)
242  file等于file
243  needcheck等于jiffies
244  ns等于ns
245  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & lock)
246  INIT_WORK( & work, close_work)
247  init_completion( & done)
248  mutex_lock_nested( & lock, 1)
249  pin_insert( & pin, mnt)
251  _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
252  old等于xchg( & bacct, & pin)
253  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.
254  pin_kill(old)
255  __mnt_drop_write(mnt)
256  mntput(mnt)
257  返回:0
调用者
名称描述
SYSCALL_DEFINE1sys_acct - enable/disable process accounting*@name: file name for accounting records or NULL to shutdown accounting* Returns 0 for success or negative errno values for failure.* sys_acct() is the only system call needed to implement process* accounting