diff options
Diffstat (limited to 'drivers/android/binderfs.c')
| -rw-r--r-- | drivers/android/binderfs.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 6a2185eb66c5..e773f45d19d9 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c | |||
| @@ -395,6 +395,11 @@ static int binderfs_binder_ctl_create(struct super_block *sb) | |||
| 395 | struct inode *inode = NULL; | 395 | struct inode *inode = NULL; |
| 396 | struct dentry *root = sb->s_root; | 396 | struct dentry *root = sb->s_root; |
| 397 | struct binderfs_info *info = sb->s_fs_info; | 397 | struct binderfs_info *info = sb->s_fs_info; |
| 398 | #if defined(CONFIG_IPC_NS) | ||
| 399 | bool use_reserve = (info->ipc_ns == &init_ipc_ns); | ||
| 400 | #else | ||
| 401 | bool use_reserve = true; | ||
| 402 | #endif | ||
| 398 | 403 | ||
| 399 | device = kzalloc(sizeof(*device), GFP_KERNEL); | 404 | device = kzalloc(sizeof(*device), GFP_KERNEL); |
| 400 | if (!device) | 405 | if (!device) |
| @@ -413,7 +418,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb) | |||
| 413 | 418 | ||
| 414 | /* Reserve a new minor number for the new device. */ | 419 | /* Reserve a new minor number for the new device. */ |
| 415 | mutex_lock(&binderfs_minors_mutex); | 420 | mutex_lock(&binderfs_minors_mutex); |
| 416 | minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL); | 421 | minor = ida_alloc_max(&binderfs_minors, |
| 422 | use_reserve ? BINDERFS_MAX_MINOR : | ||
| 423 | BINDERFS_MAX_MINOR_CAPPED, | ||
| 424 | GFP_KERNEL); | ||
| 417 | mutex_unlock(&binderfs_minors_mutex); | 425 | mutex_unlock(&binderfs_minors_mutex); |
| 418 | if (minor < 0) { | 426 | if (minor < 0) { |
| 419 | ret = minor; | 427 | ret = minor; |
| @@ -542,7 +550,7 @@ static struct file_system_type binder_fs_type = { | |||
| 542 | .fs_flags = FS_USERNS_MOUNT, | 550 | .fs_flags = FS_USERNS_MOUNT, |
| 543 | }; | 551 | }; |
| 544 | 552 | ||
| 545 | static int __init init_binderfs(void) | 553 | int __init init_binderfs(void) |
| 546 | { | 554 | { |
| 547 | int ret; | 555 | int ret; |
| 548 | 556 | ||
| @@ -560,5 +568,3 @@ static int __init init_binderfs(void) | |||
| 560 | 568 | ||
| 561 | return ret; | 569 | return ret; |
| 562 | } | 570 | } |
| 563 | |||
| 564 | device_initcall(init_binderfs); | ||
