xfs: replace ns_capable_noaudit

Now that capable_noaudit() is available, we don't need to keep
using ns_capable_noaudit() and specifying the usernamespace every single
time.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Carlos Maiolino 2026-08-04 11:45:54 +02:00
parent 4642259374
commit be9c45bdb1
3 changed files with 3 additions and 4 deletions

View File

@ -1174,8 +1174,7 @@ xfs_getfsmap(
if (!xfs_getfsmap_check_keys(&head->fmh_keys[0], &head->fmh_keys[1]))
return -EINVAL;
use_rmap = xfs_has_rmapbt(mp) &&
ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN);
use_rmap = xfs_has_rmapbt(mp) && capable_noaudit(CAP_SYS_ADMIN);
head->fmh_entries = 0;
/* Set up our device handlers. */

View File

@ -647,7 +647,7 @@ xfs_ioctl_setattr_get_trans(
goto out_error;
error = xfs_trans_alloc_ichange(ip, NULL, NULL, pdqp,
ns_capable_noaudit(&init_user_ns, CAP_FOWNER), &tp);
capable_noaudit(CAP_FOWNER), &tp);
if (error)
goto out_error;

View File

@ -834,7 +834,7 @@ xfs_setattr_nonsize(
}
error = xfs_trans_alloc_ichange(ip, udqp, gdqp, NULL,
ns_capable_noaudit(&init_user_ns, CAP_FOWNER), &tp);
capable_noaudit(CAP_FOWNER), &tp);
if (error)
goto out_dqrele;