tools headers UAPI: Sync linux/prctl.h with the kernel sources
[linux-2.6-microblaze.git] / fs / statfs.c
index 68cb077..0ba34c1 100644 (file)
@@ -255,7 +255,10 @@ SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf)
 
        memset(&tmp,0,sizeof(struct ustat));
        tmp.f_tfree = sbuf.f_bfree;
-       tmp.f_tinode = sbuf.f_ffree;
+       if (IS_ENABLED(CONFIG_ARCH_32BIT_USTAT_F_TINODE))
+               tmp.f_tinode = min_t(u64, sbuf.f_ffree, UINT_MAX);
+       else
+               tmp.f_tinode = sbuf.f_ffree;
 
        return copy_to_user(ubuf, &tmp, sizeof(struct ustat)) ? -EFAULT : 0;
 }