Skip to content

Commit 6540e8e

Browse files
Liujie Xieopsiff
authored andcommitted
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> (cherry picked from commit d96c75c8856ddbd5521bbdfbf935da13b5e80a0f) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent a441a75 commit 6540e8e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/staging/android/ashmem.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,15 @@ static const struct file_operations ashmem_fops = {
937937
#endif
938938
};
939939

940+
/*
941+
* is_ashmem_file - Check if struct file* is associated with ashmem
942+
*/
943+
int is_ashmem_file(struct file *file)
944+
{
945+
return file->f_op == &ashmem_fops;
946+
}
947+
EXPORT_SYMBOL_GPL(is_ashmem_file);
948+
940949
static struct miscdevice ashmem_misc = {
941950
.minor = MISC_DYNAMIC_MINOR,
942951
.name = "ashmem",

drivers/staging/android/ashmem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
#define COMPAT_ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned int)
2222
#endif
2323

24+
int is_ashmem_file(struct file *file);
25+
2426
#endif /* _LINUX_ASHMEM_H */

0 commit comments

Comments
 (0)