Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f2820f23
Commit
f2820f23
authored
Aug 30, 2003
by
Alexander Viro
Committed by
Linus Torvalds
Aug 30, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] dev_t handling cleanups (11/12)
new helper - imajor(inode)
parent
b2230d13
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
24 additions
and
19 deletions
+24
-19
arch/cris/arch-v10/drivers/eeprom.c
arch/cris/arch-v10/drivers/eeprom.c
+1
-1
arch/sparc/kernel/sys_sunos.c
arch/sparc/kernel/sys_sunos.c
+1
-1
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/kernel/sys_sunos32.c
+1
-1
arch/sparc64/solaris/misc.c
arch/sparc64/solaris/misc.c
+1
-1
arch/sparc64/solaris/timod.c
arch/sparc64/solaris/timod.c
+1
-1
drivers/block/cciss.c
drivers/block/cciss.c
+5
-5
drivers/input/mousedev.c
drivers/input/mousedev.c
+1
-1
drivers/s390/char/tape_char.c
drivers/s390/char/tape_char.c
+1
-1
fs/coda/inode.c
fs/coda/inode.c
+1
-1
fs/jffs2/file.c
fs/jffs2/file.c
+1
-1
fs/jffs2/os-linux.h
fs/jffs2/os-linux.h
+1
-1
include/linux/fs.h
include/linux/fs.h
+5
-0
include/linux/nfsd/nfsfh.h
include/linux/nfsd/nfsfh.h
+1
-1
sound/core/hwdep.c
sound/core/hwdep.c
+1
-1
sound/core/pcm_native.c
sound/core/pcm_native.c
+1
-1
sound/core/rawmidi.c
sound/core/rawmidi.c
+1
-1
No files found.
arch/cris/arch-v10/drivers/eeprom.c
View file @
f2820f23
...
...
@@ -443,7 +443,7 @@ static int eeprom_open(struct inode * inode, struct file * file)
if
(
iminor
(
inode
)
!=
EEPROM_MINOR_NR
)
return
-
ENXIO
;
if
(
major
(
inode
->
i_rdev
)
!=
EEPROM_MAJOR_NR
)
if
(
imajor
(
inode
)
!=
EEPROM_MAJOR_NR
)
return
-
ENXIO
;
if
(
eeprom
.
size
>
0
)
...
...
arch/sparc/kernel/sys_sunos.c
View file @
f2820f23
...
...
@@ -92,7 +92,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
* SunOS is so stupid some times... hmph!
*/
if
(
file
)
{
if
(
major
(
file
->
f_dentry
->
d_inode
->
i_rdev
)
==
MEM_MAJOR
&&
if
(
imajor
(
file
->
f_dentry
->
d_inode
)
==
MEM_MAJOR
&&
iminor
(
file
->
f_dentry
->
d_inode
)
==
5
)
{
flags
|=
MAP_ANONYMOUS
;
fput
(
file
);
...
...
arch/sparc64/kernel/sys_sunos32.c
View file @
f2820f23
...
...
@@ -90,7 +90,7 @@ asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 of
if
(
!
file
)
goto
out
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
major
(
inode
->
i_rdev
)
==
MEM_MAJOR
&&
iminor
(
inode
)
==
5
)
{
if
(
imajor
(
inode
)
==
MEM_MAJOR
&&
iminor
(
inode
)
==
5
)
{
flags
|=
MAP_ANONYMOUS
;
fput
(
file
);
file
=
NULL
;
...
...
arch/sparc64/solaris/misc.c
View file @
f2820f23
...
...
@@ -77,7 +77,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o
goto
out
;
else
{
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
if
(
major
(
inode
->
i_rdev
)
==
MEM_MAJOR
&&
if
(
imajor
(
inode
)
==
MEM_MAJOR
&&
iminor
(
inode
)
==
5
)
{
flags
|=
MAP_ANONYMOUS
;
fput
(
file
);
...
...
arch/sparc64/solaris/timod.c
View file @
f2820f23
...
...
@@ -924,7 +924,7 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
if
(
!
ino
)
goto
out
;
if
(
!
ino
->
i_sock
&&
(
major
(
ino
->
i_rdev
)
!=
30
||
iminor
(
ino
)
!=
1
))
(
imajor
(
ino
)
!=
30
||
iminor
(
ino
)
!=
1
))
goto
out
;
ctlptr
=
(
struct
strbuf
*
)
A
(
arg1
);
...
...
drivers/block/cciss.c
View file @
f2820f23
...
...
@@ -356,11 +356,11 @@ static void cmd_free(ctlr_info_t *h, CommandList_struct *c, int got_from_pool)
*/
static
int
cciss_open
(
struct
inode
*
inode
,
struct
file
*
filep
)
{
int
ctlr
=
major
(
inode
->
i_rdev
)
-
COMPAQ_CISS_MAJOR
;
int
ctlr
=
imajor
(
inode
)
-
COMPAQ_CISS_MAJOR
;
int
dsk
=
iminor
(
inode
)
>>
NWD_SHIFT
;
#ifdef CCISS_DEBUG
printk
(
KERN_DEBUG
"cciss_open %
x (%x:%x)
\n
"
,
inode
->
i_rdev
,
ctlr
,
dsk
);
printk
(
KERN_DEBUG
"cciss_open %
s (%x:%x)
\n
"
,
inode
->
i_bdev
->
bd_disk
->
disk_name
,
ctlr
,
dsk
);
#endif
/* CCISS_DEBUG */
if
(
ctlr
>=
MAX_CTLR
||
hba
[
ctlr
]
==
NULL
)
...
...
@@ -386,11 +386,11 @@ static int cciss_open(struct inode *inode, struct file *filep)
*/
static
int
cciss_release
(
struct
inode
*
inode
,
struct
file
*
filep
)
{
int
ctlr
=
major
(
inode
->
i_rdev
)
-
COMPAQ_CISS_MAJOR
;
int
ctlr
=
imajor
(
inode
)
-
COMPAQ_CISS_MAJOR
;
int
dsk
=
iminor
(
inode
)
>>
NWD_SHIFT
;
#ifdef CCISS_DEBUG
printk
(
KERN_DEBUG
"cciss_release %
x (%x:%x)
\n
"
,
inode
->
i_rdev
,
ctlr
,
dsk
);
printk
(
KERN_DEBUG
"cciss_release %
s (%x:%x)
\n
"
,
inode
->
i_bdev
->
bd_disk
->
disk_name
,
ctlr
,
dsk
);
#endif
/* CCISS_DEBUG */
/* fsync_dev(inode->i_rdev); */
...
...
@@ -406,7 +406,7 @@ static int cciss_release(struct inode *inode, struct file *filep)
static
int
cciss_ioctl
(
struct
inode
*
inode
,
struct
file
*
filep
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
int
ctlr
=
major
(
inode
->
i_rdev
)
-
COMPAQ_CISS_MAJOR
;
int
ctlr
=
imajor
(
inode
)
-
COMPAQ_CISS_MAJOR
;
int
dsk
=
iminor
(
inode
)
>>
NWD_SHIFT
;
#ifdef CCISS_DEBUG
...
...
drivers/input/mousedev.c
View file @
f2820f23
...
...
@@ -228,7 +228,7 @@ static int mousedev_open(struct inode * inode, struct file * file)
int
i
;
#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
if
(
major
(
inode
->
i_rdev
)
==
MISC_MAJOR
)
if
(
imajor
(
inode
)
==
MISC_MAJOR
)
i
=
MOUSEDEV_MIX
;
else
#endif
...
...
drivers/s390/char/tape_char.c
View file @
f2820f23
...
...
@@ -238,7 +238,7 @@ tapechar_open (struct inode *inode, struct file *filp)
struct
tape_device
*
device
;
int
minor
,
rc
;
if
(
major
(
filp
->
f_dentry
->
d_inode
->
i_rdev
)
!=
tapechar_major
)
if
(
imajor
(
filp
->
f_dentry
->
d_inode
)
!=
tapechar_major
)
return
-
ENODEV
;
minor
=
iminor
(
filp
->
f_dentry
->
d_inode
);
device
=
tape_get_device
(
minor
/
TAPE_MINORS_PER_DEV
);
...
...
fs/coda/inode.c
View file @
f2820f23
...
...
@@ -115,7 +115,7 @@ static int get_device_index(struct coda_mount_data *data)
inode
=
file
->
f_dentry
->
d_inode
;
if
(
!
inode
||
!
S_ISCHR
(
inode
->
i_mode
)
||
major
(
inode
->
i_rdev
)
!=
CODA_PSDEV_MAJOR
)
{
imajor
(
inode
)
!=
CODA_PSDEV_MAJOR
)
{
if
(
file
)
fput
(
file
);
...
...
fs/jffs2/file.c
View file @
f2820f23
...
...
@@ -103,7 +103,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
it out again with the appropriate data attached */
if
(
S_ISBLK
(
inode
->
i_mode
)
||
S_ISCHR
(
inode
->
i_mode
))
{
/* For these, we don't actually need to read the old node */
dev
=
(
major
(
dentry
->
d_inode
->
i_rdev
)
<<
8
)
|
dev
=
(
imajor
(
dentry
->
d_inode
)
<<
8
)
|
iminor
(
dentry
->
d_inode
);
mdata
=
(
char
*
)
&
dev
;
mdatalen
=
sizeof
(
dev
);
...
...
fs/jffs2/os-linux.h
View file @
f2820f23
...
...
@@ -45,7 +45,7 @@
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,1)
#define JFFS2_F_I_RDEV_MIN(f) (iminor(OFNI_EDONI_2SFFJ(f)))
#define JFFS2_F_I_RDEV_MAJ(f) (
major(OFNI_EDONI_2SFFJ(f)->i_rdev
))
#define JFFS2_F_I_RDEV_MAJ(f) (
imajor(OFNI_EDONI_2SFFJ(f)
))
#else
#define JFFS2_F_I_RDEV_MIN(f) (MINOR(to_kdev_t(OFNI_EDONI_2SFFJ(f)->i_rdev)))
#define JFFS2_F_I_RDEV_MAJ(f) (MAJOR(to_kdev_t(OFNI_EDONI_2SFFJ(f)->i_rdev)))
...
...
include/linux/fs.h
View file @
f2820f23
...
...
@@ -472,6 +472,11 @@ static inline unsigned iminor(struct inode *inode)
return
minor
(
inode
->
i_rdev
);
}
static
inline
unsigned
imajor
(
struct
inode
*
inode
)
{
return
major
(
inode
->
i_rdev
);
}
struct
fown_struct
{
rwlock_t
lock
;
/* protects pid, uid, euid fields */
int
pid
;
/* pid or -pgrp where SIGIO should be sent */
...
...
include/linux/nfsd/nfsfh.h
View file @
f2820f23
...
...
@@ -294,7 +294,7 @@ fill_post_wcc(struct svc_fh *fhp)
/* how much do we care for accuracy with MinixFS? */
fhp
->
fh_post_blocks
=
(
inode
->
i_size
+
511
)
>>
9
;
}
fhp
->
fh_post_rdev
[
0
]
=
htonl
((
u32
)
major
(
inode
->
i_rdev
));
fhp
->
fh_post_rdev
[
0
]
=
htonl
((
u32
)
imajor
(
inode
));
fhp
->
fh_post_rdev
[
1
]
=
htonl
((
u32
)
iminor
(
inode
));
fhp
->
fh_post_atime
=
inode
->
i_atime
;
fhp
->
fh_post_mtime
=
inode
->
i_mtime
;
...
...
sound/core/hwdep.c
View file @
f2820f23
...
...
@@ -73,7 +73,7 @@ static ssize_t snd_hwdep_write(struct file * file, const char *buf, size_t count
static
int
snd_hwdep_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
int
major
=
major
(
inode
->
i_rdev
);
int
major
=
imajor
(
inode
);
int
cardnum
;
int
device
;
snd_hwdep_t
*
hw
;
...
...
sound/core/pcm_native.c
View file @
f2820f23
...
...
@@ -1431,7 +1431,7 @@ static struct file *snd_pcm_file_fd(int fd)
return
0
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
!
S_ISCHR
(
inode
->
i_mode
)
||
major
(
inode
->
i_rdev
)
!=
snd_major
)
{
imajor
(
inode
)
!=
snd_major
)
{
fput
(
file
);
return
0
;
}
...
...
sound/core/rawmidi.c
View file @
f2820f23
...
...
@@ -345,7 +345,7 @@ int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice,
static
int
snd_rawmidi_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
int
maj
=
major
(
inode
->
i_rdev
);
int
maj
=
imajor
(
inode
);
int
cardnum
;
snd_card_t
*
card
;
int
device
,
subdevice
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment