mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
util: use glibc macros to generate device numbers in the dev_t format
Our version of macroses are worng. Our macros: #define MINOR(dev) ((dev) & 0xff) Glibc function: return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); Reported-by: Amey Deshpande <ameyd@google.com> Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
74a2cce189
commit
3a9c6a3d37
@@ -211,11 +211,8 @@ static inline dev_t kdev_to_odev(u32 kdev)
|
||||
*/
|
||||
unsigned major = kdev_major(kdev);
|
||||
unsigned minor = kdev_minor(kdev);
|
||||
#if BITS_PER_LONG == 32
|
||||
return (major << 8) | minor;
|
||||
#else
|
||||
return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
|
||||
#endif
|
||||
|
||||
return makedev(major, minor);
|
||||
}
|
||||
|
||||
extern int copy_file(int fd_in, int fd_out, size_t bytes);
|
||||
|
Reference in New Issue
Block a user