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
nexedi
linux
Commits
d8c9584e
Commit
d8c9584e
authored
Dec 07, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ece2ccb6
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
27 additions
and
25 deletions
+27
-25
fs/autofs4/dev-ioctl.c
fs/autofs4/dev-ioctl.c
+5
-5
fs/binfmt_misc.c
fs/binfmt_misc.c
+3
-3
fs/ext3/super.c
fs/ext3/super.c
+1
-1
fs/ext4/super.c
fs/ext4/super.c
+1
-1
fs/fhandle.c
fs/fhandle.c
+2
-2
fs/lockd/svcsubs.c
fs/lockd/svcsubs.c
+1
-1
fs/nfsd/nfsctl.c
fs/nfsd/nfsctl.c
+1
-1
fs/quota/dquot.c
fs/quota/dquot.c
+1
-1
fs/reiserfs/super.c
fs/reiserfs/super.c
+1
-1
fs/sysv/itree.c
fs/sysv/itree.c
+1
-1
init/do_mounts.c
init/do_mounts.c
+6
-4
kernel/acct.c
kernel/acct.c
+1
-1
security/selinux/hooks.c
security/selinux/hooks.c
+1
-1
security/smack/smack_lsm.c
security/smack/smack_lsm.c
+2
-2
No files found.
fs/autofs4/dev-ioctl.c
View file @
d8c9584e
...
@@ -194,7 +194,7 @@ static int find_autofs_mount(const char *pathname,
...
@@ -194,7 +194,7 @@ static int find_autofs_mount(const char *pathname,
return
err
;
return
err
;
err
=
-
ENOENT
;
err
=
-
ENOENT
;
while
(
path
.
dentry
==
path
.
mnt
->
mnt_root
)
{
while
(
path
.
dentry
==
path
.
mnt
->
mnt_root
)
{
if
(
path
.
mnt
->
mnt
_sb
->
s_magic
==
AUTOFS_SUPER_MAGIC
)
{
if
(
path
.
dentry
->
d
_sb
->
s_magic
==
AUTOFS_SUPER_MAGIC
)
{
if
(
test
(
&
path
,
data
))
{
if
(
test
(
&
path
,
data
))
{
path_get
(
&
path
);
path_get
(
&
path
);
if
(
!
err
)
/* already found some */
if
(
!
err
)
/* already found some */
...
@@ -212,7 +212,7 @@ static int find_autofs_mount(const char *pathname,
...
@@ -212,7 +212,7 @@ static int find_autofs_mount(const char *pathname,
static
int
test_by_dev
(
struct
path
*
path
,
void
*
p
)
static
int
test_by_dev
(
struct
path
*
path
,
void
*
p
)
{
{
return
path
->
mnt
->
mnt
_sb
->
s_dev
==
*
(
dev_t
*
)
p
;
return
path
->
dentry
->
d
_sb
->
s_dev
==
*
(
dev_t
*
)
p
;
}
}
static
int
test_by_type
(
struct
path
*
path
,
void
*
p
)
static
int
test_by_type
(
struct
path
*
path
,
void
*
p
)
...
@@ -538,11 +538,11 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
...
@@ -538,11 +538,11 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
err
=
find_autofs_mount
(
name
,
&
path
,
test_by_type
,
&
type
);
err
=
find_autofs_mount
(
name
,
&
path
,
test_by_type
,
&
type
);
if
(
err
)
if
(
err
)
goto
out
;
goto
out
;
devid
=
new_encode_dev
(
path
.
mnt
->
mnt
_sb
->
s_dev
);
devid
=
new_encode_dev
(
path
.
dentry
->
d
_sb
->
s_dev
);
err
=
0
;
err
=
0
;
if
(
path
.
mnt
->
mnt_root
==
path
.
dentry
)
{
if
(
path
.
mnt
->
mnt_root
==
path
.
dentry
)
{
err
=
1
;
err
=
1
;
magic
=
path
.
mnt
->
mnt
_sb
->
s_magic
;
magic
=
path
.
dentry
->
d
_sb
->
s_magic
;
}
}
}
else
{
}
else
{
dev_t
dev
=
sbi
->
sb
->
s_dev
;
dev_t
dev
=
sbi
->
sb
->
s_dev
;
...
@@ -556,7 +556,7 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
...
@@ -556,7 +556,7 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
err
=
have_submounts
(
path
.
dentry
);
err
=
have_submounts
(
path
.
dentry
);
if
(
follow_down_one
(
&
path
))
if
(
follow_down_one
(
&
path
))
magic
=
path
.
mnt
->
mnt
_sb
->
s_magic
;
magic
=
path
.
dentry
->
d
_sb
->
s_magic
;
}
}
param
->
ismountpoint
.
out
.
devid
=
devid
;
param
->
ismountpoint
.
out
.
devid
=
devid
;
...
...
fs/binfmt_misc.c
View file @
d8c9584e
...
@@ -560,7 +560,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
...
@@ -560,7 +560,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
break
;
break
;
case
2
:
set_bit
(
Enabled
,
&
e
->
flags
);
case
2
:
set_bit
(
Enabled
,
&
e
->
flags
);
break
;
break
;
case
3
:
root
=
dget
(
file
->
f_path
.
mnt
->
mnt
_sb
->
s_root
);
case
3
:
root
=
dget
(
file
->
f_path
.
dentry
->
d
_sb
->
s_root
);
mutex_lock
(
&
root
->
d_inode
->
i_mutex
);
mutex_lock
(
&
root
->
d_inode
->
i_mutex
);
kill_node
(
e
);
kill_node
(
e
);
...
@@ -587,7 +587,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
...
@@ -587,7 +587,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
Node
*
e
;
Node
*
e
;
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
dentry
*
root
,
*
dentry
;
struct
dentry
*
root
,
*
dentry
;
struct
super_block
*
sb
=
file
->
f_path
.
mnt
->
mnt
_sb
;
struct
super_block
*
sb
=
file
->
f_path
.
dentry
->
d
_sb
;
int
err
=
0
;
int
err
=
0
;
e
=
create_entry
(
buffer
,
count
);
e
=
create_entry
(
buffer
,
count
);
...
@@ -666,7 +666,7 @@ static ssize_t bm_status_write(struct file * file, const char __user * buffer,
...
@@ -666,7 +666,7 @@ static ssize_t bm_status_write(struct file * file, const char __user * buffer,
switch
(
res
)
{
switch
(
res
)
{
case
1
:
enabled
=
0
;
break
;
case
1
:
enabled
=
0
;
break
;
case
2
:
enabled
=
1
;
break
;
case
2
:
enabled
=
1
;
break
;
case
3
:
root
=
dget
(
file
->
f_path
.
mnt
->
mnt
_sb
->
s_root
);
case
3
:
root
=
dget
(
file
->
f_path
.
dentry
->
d
_sb
->
s_root
);
mutex_lock
(
&
root
->
d_inode
->
i_mutex
);
mutex_lock
(
&
root
->
d_inode
->
i_mutex
);
while
(
!
list_empty
(
&
entries
))
while
(
!
list_empty
(
&
entries
))
...
...
fs/ext3/super.c
View file @
d8c9584e
...
@@ -2909,7 +2909,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
...
@@ -2909,7 +2909,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
return
-
EINVAL
;
return
-
EINVAL
;
/* Quotafile not on the same filesystem? */
/* Quotafile not on the same filesystem? */
if
(
path
->
mnt
->
mnt
_sb
!=
sb
)
if
(
path
->
dentry
->
d
_sb
!=
sb
)
return
-
EXDEV
;
return
-
EXDEV
;
/* Journaling quota? */
/* Journaling quota? */
if
(
EXT3_SB
(
sb
)
->
s_qf_names
[
type
])
{
if
(
EXT3_SB
(
sb
)
->
s_qf_names
[
type
])
{
...
...
fs/ext4/super.c
View file @
d8c9584e
...
@@ -4781,7 +4781,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
...
@@ -4781,7 +4781,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
return
-
EINVAL
;
return
-
EINVAL
;
/* Quotafile not on the same filesystem? */
/* Quotafile not on the same filesystem? */
if
(
path
->
mnt
->
mnt
_sb
!=
sb
)
if
(
path
->
dentry
->
d
_sb
!=
sb
)
return
-
EXDEV
;
return
-
EXDEV
;
/* Journaling quota? */
/* Journaling quota? */
if
(
EXT4_SB
(
sb
)
->
s_qf_names
[
type
])
{
if
(
EXT4_SB
(
sb
)
->
s_qf_names
[
type
])
{
...
...
fs/fhandle.c
View file @
d8c9584e
...
@@ -25,8 +25,8 @@ static long do_sys_name_to_handle(struct path *path,
...
@@ -25,8 +25,8 @@ static long do_sys_name_to_handle(struct path *path,
* We need t make sure wether the file system
* We need t make sure wether the file system
* support decoding of the file handle
* support decoding of the file handle
*/
*/
if
(
!
path
->
mnt
->
mnt
_sb
->
s_export_op
||
if
(
!
path
->
dentry
->
d
_sb
->
s_export_op
||
!
path
->
mnt
->
mnt
_sb
->
s_export_op
->
fh_to_dentry
)
!
path
->
dentry
->
d
_sb
->
s_export_op
->
fh_to_dentry
)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
if
(
copy_from_user
(
&
f_handle
,
ufh
,
sizeof
(
struct
file_handle
)))
if
(
copy_from_user
(
&
f_handle
,
ufh
,
sizeof
(
struct
file_handle
)))
...
...
fs/lockd/svcsubs.c
View file @
d8c9584e
...
@@ -403,7 +403,7 @@ nlmsvc_match_sb(void *datap, struct nlm_file *file)
...
@@ -403,7 +403,7 @@ nlmsvc_match_sb(void *datap, struct nlm_file *file)
{
{
struct
super_block
*
sb
=
datap
;
struct
super_block
*
sb
=
datap
;
return
sb
==
file
->
f_file
->
f_path
.
mnt
->
mnt
_sb
;
return
sb
==
file
->
f_file
->
f_path
.
dentry
->
d
_sb
;
}
}
/**
/**
...
...
fs/nfsd/nfsctl.c
View file @
d8c9584e
...
@@ -272,7 +272,7 @@ static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)
...
@@ -272,7 +272,7 @@ static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)
* 2. Is that directory a mount point, or
* 2. Is that directory a mount point, or
* 3. Is that directory the root of an exported file system?
* 3. Is that directory the root of an exported file system?
*/
*/
error
=
nlmsvc_unlock_all_by_sb
(
path
.
mnt
->
mnt
_sb
);
error
=
nlmsvc_unlock_all_by_sb
(
path
.
dentry
->
d
_sb
);
path_put
(
&
path
);
path_put
(
&
path
);
return
error
;
return
error
;
...
...
fs/quota/dquot.c
View file @
d8c9584e
...
@@ -2198,7 +2198,7 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id,
...
@@ -2198,7 +2198,7 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id,
if
(
error
)
if
(
error
)
return
error
;
return
error
;
/* Quota file not on the same filesystem? */
/* Quota file not on the same filesystem? */
if
(
path
->
mnt
->
mnt
_sb
!=
sb
)
if
(
path
->
dentry
->
d
_sb
!=
sb
)
error
=
-
EXDEV
;
error
=
-
EXDEV
;
else
else
error
=
vfs_load_quota_inode
(
path
->
dentry
->
d_inode
,
type
,
error
=
vfs_load_quota_inode
(
path
->
dentry
->
d_inode
,
type
,
...
...
fs/reiserfs/super.c
View file @
d8c9584e
...
@@ -2058,7 +2058,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
...
@@ -2058,7 +2058,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
return
-
EINVAL
;
return
-
EINVAL
;
/* Quotafile not on the same filesystem? */
/* Quotafile not on the same filesystem? */
if
(
path
->
mnt
->
mnt
_sb
!=
sb
)
{
if
(
path
->
dentry
->
d
_sb
!=
sb
)
{
err
=
-
EXDEV
;
err
=
-
EXDEV
;
goto
out
;
goto
out
;
}
}
...
...
fs/sysv/itree.c
View file @
d8c9584e
...
@@ -442,7 +442,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size)
...
@@ -442,7 +442,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size)
int
sysv_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
,
struct
kstat
*
stat
)
int
sysv_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
,
struct
kstat
*
stat
)
{
{
struct
super_block
*
s
=
mnt
->
mnt
_sb
;
struct
super_block
*
s
=
dentry
->
d
_sb
;
generic_fillattr
(
dentry
->
d_inode
,
stat
);
generic_fillattr
(
dentry
->
d_inode
,
stat
);
stat
->
blocks
=
(
s
->
s_blocksize
/
512
)
*
sysv_nblocks
(
s
,
stat
->
size
);
stat
->
blocks
=
(
s
->
s_blocksize
/
512
)
*
sysv_nblocks
(
s
,
stat
->
size
);
stat
->
blksize
=
s
->
s_blocksize
;
stat
->
blksize
=
s
->
s_blocksize
;
...
...
init/do_mounts.c
View file @
d8c9584e
...
@@ -325,17 +325,19 @@ static void __init get_fs_names(char *page)
...
@@ -325,17 +325,19 @@ static void __init get_fs_names(char *page)
static
int
__init
do_mount_root
(
char
*
name
,
char
*
fs
,
int
flags
,
void
*
data
)
static
int
__init
do_mount_root
(
char
*
name
,
char
*
fs
,
int
flags
,
void
*
data
)
{
{
struct
super_block
*
s
;
int
err
=
sys_mount
(
name
,
"/root"
,
fs
,
flags
,
data
);
int
err
=
sys_mount
(
name
,
"/root"
,
fs
,
flags
,
data
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
sys_chdir
((
const
char
__user
__force
*
)
"/root"
);
sys_chdir
((
const
char
__user
__force
*
)
"/root"
);
ROOT_DEV
=
current
->
fs
->
pwd
.
mnt
->
mnt_sb
->
s_dev
;
s
=
current
->
fs
->
pwd
.
dentry
->
d_sb
;
ROOT_DEV
=
s
->
s_dev
;
printk
(
KERN_INFO
printk
(
KERN_INFO
"VFS: Mounted root (%s filesystem)%s on device %u:%u.
\n
"
,
"VFS: Mounted root (%s filesystem)%s on device %u:%u.
\n
"
,
current
->
fs
->
pwd
.
mnt
->
mnt_sb
->
s_type
->
name
,
s
->
s_type
->
name
,
current
->
fs
->
pwd
.
mnt
->
mnt_sb
->
s_flags
&
MS_RDONLY
?
s
->
s_flags
&
MS_RDONLY
?
" readonly"
:
""
,
" readonly"
:
""
,
MAJOR
(
ROOT_DEV
),
MINOR
(
ROOT_DEV
));
MAJOR
(
ROOT_DEV
),
MINOR
(
ROOT_DEV
));
return
0
;
return
0
;
}
}
...
...
kernel/acct.c
View file @
d8c9584e
...
@@ -315,7 +315,7 @@ void acct_auto_close(struct super_block *sb)
...
@@ -315,7 +315,7 @@ void acct_auto_close(struct super_block *sb)
spin_lock
(
&
acct_lock
);
spin_lock
(
&
acct_lock
);
restart:
restart:
list_for_each_entry
(
acct
,
&
acct_list
,
list
)
list_for_each_entry
(
acct
,
&
acct_list
,
list
)
if
(
acct
->
file
&&
acct
->
file
->
f_path
.
mnt
->
mnt
_sb
==
sb
)
{
if
(
acct
->
file
&&
acct
->
file
->
f_path
.
dentry
->
d
_sb
==
sb
)
{
acct_file_reopen
(
acct
,
NULL
,
NULL
);
acct_file_reopen
(
acct
,
NULL
,
NULL
);
goto
restart
;
goto
restart
;
}
}
...
...
security/selinux/hooks.c
View file @
d8c9584e
...
@@ -2507,7 +2507,7 @@ static int selinux_mount(char *dev_name,
...
@@ -2507,7 +2507,7 @@ static int selinux_mount(char *dev_name,
const
struct
cred
*
cred
=
current_cred
();
const
struct
cred
*
cred
=
current_cred
();
if
(
flags
&
MS_REMOUNT
)
if
(
flags
&
MS_REMOUNT
)
return
superblock_has_perm
(
cred
,
path
->
mnt
->
mnt
_sb
,
return
superblock_has_perm
(
cred
,
path
->
dentry
->
d
_sb
,
FILESYSTEM__REMOUNT
,
NULL
);
FILESYSTEM__REMOUNT
,
NULL
);
else
else
return
path_has_perm
(
cred
,
path
,
FILE__MOUNTON
);
return
path_has_perm
(
cred
,
path
,
FILE__MOUNTON
);
...
...
security/smack/smack_lsm.c
View file @
d8c9584e
...
@@ -406,7 +406,7 @@ static int smack_sb_statfs(struct dentry *dentry)
...
@@ -406,7 +406,7 @@ static int smack_sb_statfs(struct dentry *dentry)
static
int
smack_sb_mount
(
char
*
dev_name
,
struct
path
*
path
,
static
int
smack_sb_mount
(
char
*
dev_name
,
struct
path
*
path
,
char
*
type
,
unsigned
long
flags
,
void
*
data
)
char
*
type
,
unsigned
long
flags
,
void
*
data
)
{
{
struct
superblock_smack
*
sbp
=
path
->
mnt
->
mnt
_sb
->
s_security
;
struct
superblock_smack
*
sbp
=
path
->
dentry
->
d
_sb
->
s_security
;
struct
smk_audit_info
ad
;
struct
smk_audit_info
ad
;
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
...
@@ -435,7 +435,7 @@ static int smack_sb_umount(struct vfsmount *mnt, int flags)
...
@@ -435,7 +435,7 @@ static int smack_sb_umount(struct vfsmount *mnt, int flags)
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_setfield_u_fs_path
(
&
ad
,
path
);
smk_ad_setfield_u_fs_path
(
&
ad
,
path
);
sbp
=
mnt
->
mnt
_sb
->
s_security
;
sbp
=
path
.
dentry
->
d
_sb
->
s_security
;
return
smk_curacc
(
sbp
->
smk_floor
,
MAY_WRITE
,
&
ad
);
return
smk_curacc
(
sbp
->
smk_floor
,
MAY_WRITE
,
&
ad
);
}
}
...
...
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