函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\notify\fanotify\fanotify.c Create Date:2022-07-29 10:49:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:fanotify_encode_fid

函数原型:static int fanotify_encode_fid(struct fanotify_event *event, struct inode *inode, gfp_t gfp, __kernel_fsid_t *fsid)

返回类型:int

参数:

类型参数名称
struct fanotify_event *event
struct inode *inode
gfp_tgfp
__kernel_fsid_t *fsid
217  fid等于With FAN_REPORT_FID, we do not hold any reference on the* victim object. Instead we store its NFS file handle and its* filesystem's fsid as a unique identifier.
218  bytes等于0
221  ext_fh = NULL
222  dwords等于0
223  err等于负ENOENT
224  type等于exportfs_encode_inode_fh(inode, NULL, & dwords, NULL)
225  如果非dwords则转到:out_err
228  bytes等于dwords左移2位
229  如果bytes大于3 dwords are sufficient for most local fs (64bit ino, 32bit generation)
231  err等于负ENOMEM
232  ext_fh等于开辟内存
233  如果非ext_fh则转到:out_err
237  type等于exportfs_encode_inode_fh(inode, fanotify_fid_fh(fid, bytes), & dwords, NULL)
239  err等于负EINVAL
240  如果非typetype恒等于FILEID_INVALIDbytes不等于dwords左移2位则转到:out_err
243  fsid等于fsid
244  fh_len等于bytes
246  返回:type
248  out_err :
249  pr_warn_ratelimited("fanotify: failed to encode fid (fsid=%x.%x, type=%d, bytes=%d, err=%i)\n", val[0], val[1], type, bytes, err)
252  释放内存
253  ext_fh = NULL
254  fh_len等于0
256  返回:FILEID_INVALID
调用者
名称描述
fanotify_alloc_event