ANDROID: ashmem: Export is_ashmem_file

Export is_ashmem_file function which will be used
by the minidump module to get ashmem info.

Bug: 193397560
Change-Id: I5b7816ad4775e5cf2c4f41c28b1c8dacc2c85b7e
Signed-off-by: liuhailong <liuhailong@oppo.com>
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
This commit is contained in:
Liujie Xie
2021-07-12 20:37:25 +08:00
committed by Suren Baghdasaryan
parent dd139186ef
commit 7bcfde2601
2 changed files with 11 additions and 0 deletions

View File

@@ -915,6 +915,15 @@ static const struct file_operations ashmem_fops = {
#endif
};
/*
* is_ashmem_file - Check if struct file* is associated with ashmem
*/
int is_ashmem_file(struct file *file)
{
return file->f_op == &ashmem_fops;
}
EXPORT_SYMBOL_GPL(is_ashmem_file);
static struct miscdevice ashmem_misc = {
.minor = MISC_DYNAMIC_MINOR,
.name = "ashmem",

View File

@@ -21,4 +21,6 @@
#define COMPAT_ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned int)
#endif
int is_ashmem_file(struct file *file);
#endif /* _LINUX_ASHMEM_H */