/* UBIFS has so-called "reserved pool" which is flash space reserved for the superuser and for uses whose UID/GID is recorded in UBIFS superblock. This function checks whether current user is allowed to use reserved pool. Returns %1 current user is allowed to use reserved pool and %0 otherwise.  */
static int can_use_rp(struct ubifs_info *c)
/* UBIFS has so-called "reserved pool" which is flash space reserved for the superuser and for uses whose UID/GID is recorded in UBIFS superblock. This function checks whether current user is allowed to use reserved pool. Returns %1 current user is allowed to use reserved pool and %0 otherwise.  */
static int can_use_rp(struct ubifs_info *c)
{
	if (uid_eq(current_fsuid(), c->rp_uid) || capable(CAP_SYS_RESOURCE) ||
	    (!gid_eq(c->rp_gid, GLOBAL_ROOT_GID) && in_group_p(c->rp_gid)))
		return 1;
	return 0;
}