.parse_downcall = mdt_identity_parse_downcall,
};
-void mdt_flush_identity(struct upcall_cache *cache, __u32 uid)
+void mdt_flush_identity(struct upcall_cache *cache, int uid)
{
- if (uid == -1)
+ if (uid < 0)
upcall_cache_flush_idle(cache);
else
upcall_cache_flush_one(cache, (__u64)uid, NULL);
void mdt_identity_put(struct upcall_cache *, struct mdt_identity *);
-void mdt_flush_identity(struct upcall_cache *, __u32);
+void mdt_flush_identity(struct upcall_cache *, int);
__u32 mdt_identity_get_setxid_perm(struct mdt_identity *, __u32, lnet_nid_t);
{
struct obd_device *obd = data;
struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+ char tmp[8];
+ int uid;
- upcall_cache_flush_idle(mdt->mdt_identity_cache);
+ memset(tmp, 0, 8);
+ if (copy_from_user(tmp, buffer, (count > 7) ? 7 : count)) {
+ CERROR("%s: bad data\n", obd->obd_name);
+ return -EFAULT;
+ }
+
+ if (sscanf(tmp, "%d", &uid) != 1) {
+ CERROR("%s: invalid uid\n", obd->obd_name);
+ return -EFAULT;
+ }
+
+ mdt_flush_identity(mdt->mdt_identity_cache, uid);
return count;
}
if (!mdt->mdt_rootsquash_info)
OBD_ALLOC_PTR(mdt->mdt_rootsquash_info);
if (!mdt->mdt_rootsquash_info)
- RETURN(-ENOMEM);
+ return -ENOMEM;
mdt->mdt_rootsquash_info->rsi_uid = val;
return count;
if (!mdt->mdt_rootsquash_info)
OBD_ALLOC_PTR(mdt->mdt_rootsquash_info);
if (!mdt->mdt_rootsquash_info)
- RETURN(-ENOMEM);
+ return -ENOMEM;
mdt->mdt_rootsquash_info->rsi_gid = val;
return count;
if (!mdt->mdt_rootsquash_info)
OBD_ALLOC_PTR(mdt->mdt_rootsquash_info);
if (!mdt->mdt_rootsquash_info)
- RETURN(-ENOMEM);
+ return -ENOMEM;
remove_newline(skips);
do_process_nosquash_nids(mdt, skips);