Release 4.12 include/linux/kdev_t.h
#ifndef _LINUX_KDEV_T_H
#define _LINUX_KDEV_T_H
#include <uapi/linux/kdev_t.h>
#define MINORBITS 20
#define MINORMASK ((1U << MINORBITS) - 1)
#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS))
#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
#define print_dev_t(buffer, dev) \
sprintf((buffer), "%u:%u\n", MAJOR(dev), MINOR(dev))
#define format_dev_t(buffer, dev) \
({ \
sprintf(buffer, "%u:%u", MAJOR(dev), MINOR(dev)); \
buffer; \
})
/* acceptable for old filesystems */
static inline bool old_valid_dev(dev_t dev)
{
return MAJOR(dev) < 256 && MINOR(dev) < 256;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 24 | 96.00% | 1 | 50.00% |
Yaowei Bai | 1 | 4.00% | 1 | 50.00% |
Total | 25 | 100.00% | 2 | 100.00% |
static inline u16 old_encode_dev(dev_t dev)
{
return (MAJOR(dev) << 8) | MINOR(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 25 | 100.00% | 1 | 100.00% |
Total | 25 | 100.00% | 1 | 100.00% |
static inline dev_t old_decode_dev(u16 val)
{
return MKDEV((val >> 8) & 255, val & 255);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
static inline u32 new_encode_dev(dev_t dev)
{
unsigned major = MAJOR(dev);
unsigned minor = MINOR(dev);
return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 50 | 100.00% | 1 | 100.00% |
Total | 50 | 100.00% | 1 | 100.00% |
static inline dev_t new_decode_dev(u32 dev)
{
unsigned major = (dev & 0xfff00) >> 8;
unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
return MKDEV(major, minor);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 48 | 100.00% | 1 | 100.00% |
Total | 48 | 100.00% | 1 | 100.00% |
static inline u64 huge_encode_dev(dev_t dev)
{
return new_encode_dev(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline dev_t huge_decode_dev(u64 dev)
{
return new_decode_dev(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline int sysv_valid_dev(dev_t dev)
{
return MAJOR(dev) < (1<<14) && MINOR(dev) < (1<<18);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 33 | 100.00% | 1 | 100.00% |
Total | 33 | 100.00% | 1 | 100.00% |
static inline u32 sysv_encode_dev(dev_t dev)
{
return MINOR(dev) | (MAJOR(dev) << 18);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 25 | 100.00% | 1 | 100.00% |
Total | 25 | 100.00% | 1 | 100.00% |
static inline unsigned sysv_major(u32 dev)
{
return (dev >> 18) & 0x3fff;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
static inline unsigned sysv_minor(u32 dev)
{
return dev & 0x3ffff;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#endif
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Al Viro | 299 | 82.83% | 1 | 16.67% |
Linus Torvalds | 30 | 8.31% | 1 | 16.67% |
Andrew Morton | 20 | 5.54% | 1 | 16.67% |
Linus Torvalds (pre-git) | 8 | 2.22% | 1 | 16.67% |
David Howells | 3 | 0.83% | 1 | 16.67% |
Yaowei Bai | 1 | 0.28% | 1 | 16.67% |
Total | 361 | 100.00% | 6 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.