Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\notify\fanotify\fanotify.c Create Date:2022-07-28 20:18:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:fanotify_encode_fid

Proto:static int fanotify_encode_fid(struct fanotify_event *event, struct inode *inode, gfp_t gfp, __kernel_fsid_t *fsid)

Type:int

Parameter:

TypeParameterName
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  If Not dwords Then Go to out_err
228  bytes = dwords << 2
229  If bytes > 3 dwords are sufficient for most local fs (64bit ino, 32bit generation) Then
231  err = -ENOMEM
232  ext_fh = Allocation memory
233  If Not ext_fh Then Go to out_err
237  type = exportfs_encode_inode_fh(inode, fanotify_fid_fh(fid, bytes), & dwords, NULL)
239  err = -EINVAL
240  If Not type || type == FILEID_INVALID || bytes != dwords << 2 Then Go to out_err
243  fsid = fsid
244  fh_len = bytes
246  Return 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  kfree(ext_fh)
253  ext_fh = NULL
254  fh_len = 0
256  Return FILEID_INVALID
Caller
NameDescribe
fanotify_alloc_event