Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2eb90a75 authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman
Browse files

staging/lustre/libcfs: remove cfs_capable



Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarPeng Tao <bergwolf@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent efc9eb02
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -84,7 +84,6 @@ void cfs_cap_raise(cfs_cap_t cap);
void cfs_cap_lower(cfs_cap_t cap);
int cfs_cap_raised(cfs_cap_t cap);
cfs_cap_t cfs_curproc_cap_pack(void);
int cfs_capable(cfs_cap_t cap);

/* __LIBCFS_CURPROC_H__ */
#endif
+0 −6
Original line number Diff line number Diff line
@@ -96,11 +96,6 @@ cfs_cap_t cfs_curproc_cap_pack(void)
	return cap;
}

int cfs_capable(cfs_cap_t cap)
{
	return capable(cap);
}

static int cfs_access_process_vm(struct task_struct *tsk, unsigned long addr,
				 void *buf, int len, int write)
{
@@ -257,7 +252,6 @@ EXPORT_SYMBOL(cfs_cap_raise);
EXPORT_SYMBOL(cfs_cap_lower);
EXPORT_SYMBOL(cfs_cap_raised);
EXPORT_SYMBOL(cfs_curproc_cap_pack);
EXPORT_SYMBOL(cfs_capable);

/*
 * Local variables:
+2 −2
Original line number Diff line number Diff line
@@ -150,12 +150,12 @@ static long libcfs_ioctl(struct file *file,
	/* Handle platform-dependent IOC requests */
	switch (cmd) {
	case IOC_LIBCFS_PANIC:
		if (!cfs_capable(CFS_CAP_SYS_BOOT))
		if (!capable(CFS_CAP_SYS_BOOT))
			return (-EPERM);
		panic("debugctl-invoked panic");
		return (0);
	case IOC_LIBCFS_MEMHOG:
		if (!cfs_capable(CFS_CAP_SYS_ADMIN))
		if (!capable(CFS_CAP_SYS_ADMIN))
			return -EPERM;
		/* go thought */
	}
+4 −4
Original line number Diff line number Diff line
@@ -1085,7 +1085,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
	case Q_QUOTAOFF:
	case Q_SETQUOTA:
	case Q_SETINFO:
		if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
		if (!capable(CFS_CAP_SYS_ADMIN) ||
		    sbi->ll_flags & LL_SBI_RMT_CLIENT)
			return -EPERM;
		break;
@@ -1094,7 +1094,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
		      uid_eq(current_euid(), make_kuid(&init_user_ns, id))) ||
		     (type == GRPQUOTA &&
		      !in_egroup_p(make_kgid(&init_user_ns, id)))) &&
		    (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
		    (!capable(CFS_CAP_SYS_ADMIN) ||
		     sbi->ll_flags & LL_SBI_RMT_CLIENT))
			return -EPERM;
		break;
@@ -1602,7 +1602,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
		struct obd_quotactl *oqctl;
		int error = 0;

		if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
		if (!capable(CFS_CAP_SYS_ADMIN) ||
		    sbi->ll_flags & LL_SBI_RMT_CLIENT)
			return -EPERM;

@@ -1626,7 +1626,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
	case OBD_IOC_POLL_QUOTACHECK: {
		struct if_quotacheck *check;

		if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
		if (!capable(CFS_CAP_SYS_ADMIN) ||
		    sbi->ll_flags & LL_SBI_RMT_CLIENT)
			return -EPERM;

+5 −5
Original line number Diff line number Diff line
@@ -1340,7 +1340,7 @@ static int ll_lov_recreate_obj(struct inode *inode, unsigned long arg)
	struct ll_recreate_obj ucreat;
	struct ost_id		oi;

	if (!cfs_capable(CFS_CAP_SYS_ADMIN))
	if (!capable(CFS_CAP_SYS_ADMIN))
		return -EPERM;

	if (copy_from_user(&ucreat, (struct ll_recreate_obj *)arg,
@@ -1358,7 +1358,7 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
	struct ost_id	oi;
	obd_count	ost_idx;

	if (!cfs_capable(CFS_CAP_SYS_ADMIN))
	if (!capable(CFS_CAP_SYS_ADMIN))
		return -EPERM;

	if (copy_from_user(&fid, (struct lu_fid *)arg, sizeof(fid)))
@@ -1497,7 +1497,7 @@ static int ll_lov_setea(struct inode *inode, struct file *file,
					    sizeof(struct lov_user_ost_data);
	int			 rc;

	if (!cfs_capable(CFS_CAP_SYS_ADMIN))
	if (!capable(CFS_CAP_SYS_ADMIN))
		return -EPERM;

	OBD_ALLOC_LARGE(lump, lum_size);
@@ -1747,7 +1747,7 @@ int ll_fid2path(struct inode *inode, void *arg)
	struct getinfo_fid2path	*gfout, *gfin;
	int			 outsize, rc;

	if (!cfs_capable(CFS_CAP_DAC_READ_SEARCH) &&
	if (!capable(CFS_CAP_DAC_READ_SEARCH) &&
	    !(ll_i2sbi(inode)->ll_flags & LL_SBI_USER_FID2PATH))
		return -EPERM;

@@ -2093,7 +2093,7 @@ static int ll_hsm_state_set(struct inode *inode, struct hsm_state_set *hss)
	/* Non-root users are forbidden to set or clear flags which are
	 * NOT defined in HSM_USER_MASK. */
	if (((hss->hss_setmask | hss->hss_clearmask) & ~HSM_USER_MASK) &&
	    !cfs_capable(CFS_CAP_SYS_ADMIN))
	    !capable(CFS_CAP_SYS_ADMIN))
		return -EPERM;

	op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
Loading