fs: use type safe idmapping helpers
[linux-block.git] / fs / inode.c
index 8c4078889754febf4284a3d4bfb63007effa3143..757cac29bd5a8dfd1e349846b6b3b2fd5e6bb5e6 100644 (file)
@@ -2326,15 +2326,15 @@ EXPORT_SYMBOL(inode_init_owner);
 bool inode_owner_or_capable(struct user_namespace *mnt_userns,
                            const struct inode *inode)
 {
-       kuid_t i_uid;
+       vfsuid_t vfsuid;
        struct user_namespace *ns;
 
-       i_uid = i_uid_into_mnt(mnt_userns, inode);
-       if (uid_eq(current_fsuid(), i_uid))
+       vfsuid = i_uid_into_vfsuid(mnt_userns, inode);
+       if (vfsuid_eq_kuid(vfsuid, current_fsuid()))
                return true;
 
        ns = current_user_ns();
-       if (kuid_has_mapping(ns, i_uid) && ns_capable(ns, CAP_FOWNER))
+       if (vfsuid_has_mapping(ns, vfsuid) && ns_capable(ns, CAP_FOWNER))
                return true;
        return false;
 }