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
1eafe709
Commit
1eafe709
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 2.3.99pre2-2
parent
cef52a34
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
215 additions
and
296 deletions
+215
-296
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+2
-2
drivers/char/raw.c
drivers/char/raw.c
+1
-1
drivers/char/sysrq.c
drivers/char/sysrq.c
+1
-3
drivers/pnp/quirks.c
drivers/pnp/quirks.c
+49
-2
fs/binfmt_elf.c
fs/binfmt_elf.c
+2
-4
fs/binfmt_em86.c
fs/binfmt_em86.c
+1
-1
fs/binfmt_misc.c
fs/binfmt_misc.c
+1
-1
fs/binfmt_script.c
fs/binfmt_script.c
+1
-1
fs/dquot.c
fs/dquot.c
+110
-120
fs/exec.c
fs/exec.c
+3
-3
fs/namei.c
fs/namei.c
+5
-5
fs/open.c
fs/open.c
+3
-3
fs/super.c
fs/super.c
+6
-35
include/linux/fs.h
include/linux/fs.h
+9
-3
include/linux/mount.h
include/linux/mount.h
+0
-4
include/linux/quota.h
include/linux/quota.h
+1
-1
include/linux/quotaops.h
include/linux/quotaops.h
+3
-3
ipc/shm.c
ipc/shm.c
+14
-98
kernel/acct.c
kernel/acct.c
+1
-1
kernel/ksyms.c
kernel/ksyms.c
+1
-1
kernel/sysctl.c
kernel/sysctl.c
+0
-3
net/unix/af_unix.c
net/unix/af_unix.c
+1
-1
No files found.
arch/sparc64/kernel/sys_sparc32.c
View file @
1eafe709
...
...
@@ -3059,7 +3059,7 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
memset
(
bprm
.
page
,
0
,
MAX_ARG_PAGES
*
sizeof
(
bprm
.
page
[
0
]));
lock_kernel
();
dentry
=
open_namei
(
filename
,
0
,
0
);
dentry
=
open_namei
(
filename
);
unlock_kernel
();
retval
=
PTR_ERR
(
dentry
);
...
...
@@ -4154,7 +4154,7 @@ asmlinkage long sparc32_open(const char * filename, int flags, int mode)
if
(
fd
>=
0
)
{
struct
file
*
f
;
lock_kernel
();
f
=
filp_open
(
tmp
,
flags
,
mode
);
f
=
filp_open
(
tmp
,
flags
,
mode
,
NULL
);
unlock_kernel
();
error
=
PTR_ERR
(
f
);
if
(
IS_ERR
(
f
))
...
...
drivers/char/raw.c
View file @
1eafe709
...
...
@@ -102,7 +102,7 @@ int raw_open(struct inode *inode, struct file *filp)
*/
sector_size
=
512
;
if
(
lookup_vfsmnt
(
rdev
)
!=
NULL
)
{
if
(
get_super
(
rdev
)
!=
NULL
)
{
if
(
blksize_size
[
MAJOR
(
rdev
)])
sector_size
=
blksize_size
[
MAJOR
(
rdev
)][
MINOR
(
rdev
)];
}
else
{
...
...
drivers/char/sysrq.c
View file @
1eafe709
...
...
@@ -203,7 +203,7 @@ static void go_sync(kdev_t dev, int remount_flag)
file
->
f_mode
&=
~
2
;
}
file_list_unlock
();
DQUOT_OFF
(
dev
);
DQUOT_OFF
(
sb
);
fsync_dev
(
dev
);
flags
=
MS_RDONLY
;
if
(
sb
->
s_op
&&
sb
->
s_op
->
remount_fs
)
{
...
...
@@ -212,8 +212,6 @@ static void go_sync(kdev_t dev, int remount_flag)
printk
(
"error %d
\n
"
,
ret
);
else
{
sb
->
s_flags
=
(
sb
->
s_flags
&
~
MS_RMT_MASK
)
|
(
flags
&
MS_RMT_MASK
);
if
((
vfsmnt
=
lookup_vfsmnt
(
sb
->
s_dev
)))
vfsmnt
->
mnt_flags
=
sb
->
s_flags
;
printk
(
"OK
\n
"
);
}
}
else
...
...
drivers/pnp/quirks.c
View file @
1eafe709
...
...
@@ -18,7 +18,6 @@
#include <linux/isapnp.h>
#include <linux/string.h>
static
void
__init
quirk_awe32_resources
(
struct
pci_dev
*
dev
)
{
struct
isapnp_port
*
port
,
*
port2
,
*
port3
;
...
...
@@ -67,6 +66,37 @@ static void __init quirk_cmi8330_resources(struct pci_dev *dev)
printk
(
KERN_INFO
"isapnp: CMI8330 quirk - fixing interrupts and dma
\n
"
);
}
static
void
__init
quirk_sb16audio_resources
(
struct
pci_dev
*
dev
)
{
struct
isapnp_port
*
port
;
struct
isapnp_resources
*
res
=
dev
->
sysdata
;
int
changed
=
0
;
/*
* The default range on the mtu port for these devices is 0x388-0x388.
* Here we increase that range so that two such cards can be
* auto-configured.
*/
for
(
;
res
;
res
=
res
->
alt
)
{
port
=
res
->
port
;
if
(
!
port
)
continue
;
port
=
port
->
next
;
if
(
!
port
)
continue
;
port
=
port
->
next
;
if
(
!
port
)
continue
;
if
(
port
->
min
!=
port
->
max
)
continue
;
port
->
max
+=
0x70
;
changed
=
1
;
}
if
(
changed
)
printk
(
KERN_INFO
"ISAPnP: SB audio device quirk - increasing port range
\n
"
);
return
;
}
/*
* ISAPnP Quirks
...
...
@@ -74,14 +104,31 @@ static void __init quirk_cmi8330_resources(struct pci_dev *dev)
*/
static
struct
isapnp_fixup
isapnp_fixups
[]
__initdata
=
{
/* Soundblaster awe io port quirk */
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0021
),
quirk_awe32_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0022
),
quirk_awe32_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0023
),
quirk_awe32_resources
},
{
ISAPNP_VENDOR
(
'@'
,
'X'
,
'@'
),
ISAPNP_DEVICE
(
0x0001
),
// CMI8330
/* CMI 8330 interrupt and dma fix */
{
ISAPNP_VENDOR
(
'@'
,
'X'
,
'@'
),
ISAPNP_DEVICE
(
0x0001
),
quirk_cmi8330_resources
},
/* Soundblaster audio device io port range quirk */
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0001
),
quirk_sb16audio_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0031
),
quirk_sb16audio_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0041
),
quirk_sb16audio_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0042
),
quirk_sb16audio_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0043
),
quirk_sb16audio_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0044
),
quirk_sb16audio_resources
},
{
ISAPNP_VENDOR
(
'C'
,
'T'
,
'L'
),
ISAPNP_DEVICE
(
0x0045
),
quirk_sb16audio_resources
},
{
0
}
};
...
...
fs/binfmt_elf.c
View file @
1eafe709
...
...
@@ -495,16 +495,14 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
current
->
personality
=
PER_SVR4
;
lock_kernel
();
interpreter_dentry
=
open_namei
(
elf_interpreter
,
0
,
0
);
interpreter_dentry
=
open_namei
(
elf_interpreter
);
unlock_kernel
();
current
->
personality
=
old_pers
;
}
else
#endif
{
lock_kernel
();
interpreter_dentry
=
open_namei
(
elf_interpreter
,
0
,
0
);
interpreter_dentry
=
open_namei
(
elf_interpreter
);
unlock_kernel
();
}
set_fs
(
old_fs
);
...
...
fs/binfmt_em86.c
View file @
1eafe709
...
...
@@ -81,7 +81,7 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
* space, and we don't need to copy it.
*/
lock_kernel
();
dentry
=
open_namei
(
interp
,
0
,
0
);
dentry
=
open_namei
(
interp
);
unlock_kernel
();
if
(
IS_ERR
(
dentry
))
return
PTR_ERR
(
dentry
);
...
...
fs/binfmt_misc.c
View file @
1eafe709
...
...
@@ -213,7 +213,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
bprm
->
argc
++
;
bprm
->
filename
=
iname
;
/* for binfmt_script */
dentry
=
open_namei
(
iname
,
0
,
0
);
dentry
=
open_namei
(
iname
);
retval
=
PTR_ERR
(
dentry
);
if
(
IS_ERR
(
dentry
))
goto
_ret
;
...
...
fs/binfmt_script.c
View file @
1eafe709
...
...
@@ -82,7 +82,7 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
* OK, now restart the process with the interpreter's dentry.
*/
lock_kernel
();
dentry
=
open_namei
(
interp
,
0
,
0
);
dentry
=
open_namei
(
interp
);
unlock_kernel
();
if
(
IS_ERR
(
dentry
))
return
PTR_ERR
(
dentry
);
...
...
fs/dquot.c
View file @
1eafe709
This diff is collapsed.
Click to expand it.
fs/exec.c
View file @
1eafe709
...
...
@@ -775,7 +775,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
bprm_loader
.
page
[
i
]
=
NULL
;
lock_kernel
();
dentry
=
open_namei
(
dynloader
[
0
]
,
0
,
0
);
dentry
=
open_namei
(
dynloader
[
0
]);
unlock_kernel
();
retval
=
PTR_ERR
(
dentry
);
if
(
IS_ERR
(
dentry
))
...
...
@@ -855,7 +855,7 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
memset
(
bprm
.
page
,
0
,
MAX_ARG_PAGES
*
sizeof
(
bprm
.
page
[
0
]));
lock_kernel
();
dentry
=
open_namei
(
filename
,
0
,
0
);
dentry
=
open_namei
(
filename
);
unlock_kernel
();
retval
=
PTR_ERR
(
dentry
);
...
...
@@ -944,7 +944,7 @@ int do_coredump(long signr, struct pt_regs * regs)
#else
corename
[
4
]
=
'\0'
;
#endif
file
=
filp_open
(
corename
,
O_CREAT
|
2
|
O_TRUNC
|
O_NOFOLLOW
,
0600
);
file
=
filp_open
(
corename
,
O_CREAT
|
2
|
O_TRUNC
|
O_NOFOLLOW
,
0600
,
NULL
);
if
(
IS_ERR
(
file
))
goto
fail
;
dentry
=
file
->
f_dentry
;
...
...
fs/namei.c
View file @
1eafe709
...
...
@@ -609,13 +609,13 @@ int vfs_create(struct inode *dir, struct dentry *dentry, int mode)
* which is a lot more logical, and also allows the "no perm" needed
* for symlinks (where the permissions are checked later).
*/
struct
dentry
*
open_namei
(
const
char
*
pathname
,
int
flag
,
int
mode
)
struct
dentry
*
__open_namei
(
const
char
*
pathname
,
int
flag
,
int
mode
,
struct
dentry
*
dir
)
{
int
acc_mode
,
error
;
struct
inode
*
inode
;
struct
dentry
*
dentry
;
dentry
=
lookup_dentry
(
pathname
,
NULL
,
lookup_flags
(
flag
));
dentry
=
lookup_dentry
(
pathname
,
dir
,
lookup_flags
(
flag
));
if
(
IS_ERR
(
dentry
))
return
dentry
;
...
...
@@ -1012,13 +1012,13 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
return
error
;
}
int
do_unlink
(
const
char
*
name
)
int
do_unlink
(
const
char
*
name
,
struct
dentry
*
base
)
{
int
error
;
struct
dentry
*
dir
;
struct
dentry
*
dentry
;
dentry
=
lookup_dentry
(
name
,
NULL
,
0
);
dentry
=
lookup_dentry
(
name
,
base
,
0
);
error
=
PTR_ERR
(
dentry
);
if
(
IS_ERR
(
dentry
))
goto
exit
;
...
...
@@ -1043,7 +1043,7 @@ asmlinkage long sys_unlink(const char * pathname)
if
(
IS_ERR
(
tmp
))
return
PTR_ERR
(
tmp
);
lock_kernel
();
error
=
do_unlink
(
tmp
);
error
=
do_unlink
(
tmp
,
NULL
);
unlock_kernel
();
putname
(
tmp
);
...
...
fs/open.c
View file @
1eafe709
...
...
@@ -644,7 +644,7 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group)
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
*/
struct
file
*
filp_open
(
const
char
*
filename
,
int
flags
,
int
mode
)
struct
file
*
filp_open
(
const
char
*
filename
,
int
flags
,
int
mode
,
struct
dentry
*
base
)
{
struct
inode
*
inode
;
struct
dentry
*
dentry
;
...
...
@@ -661,7 +661,7 @@ struct file *filp_open(const char * filename, int flags, int mode)
flag
++
;
if
(
flag
&
O_TRUNC
)
flag
|=
2
;
dentry
=
open_namei
(
filename
,
flag
,
mod
e
);
dentry
=
__open_namei
(
filename
,
flag
,
mode
,
bas
e
);
error
=
PTR_ERR
(
dentry
);
if
(
IS_ERR
(
dentry
))
goto
cleanup_file
;
...
...
@@ -787,7 +787,7 @@ asmlinkage long sys_open(const char * filename, int flags, int mode)
if
(
fd
>=
0
)
{
struct
file
*
f
;
lock_kernel
();
f
=
filp_open
(
tmp
,
flags
,
mode
);
f
=
filp_open
(
tmp
,
flags
,
mode
,
NULL
);
unlock_kernel
();
error
=
PTR_ERR
(
f
);
if
(
IS_ERR
(
f
))
...
...
fs/super.c
View file @
1eafe709
...
...
@@ -247,32 +247,9 @@ static struct file_system_type *get_fs_type(const char *name)
return
fs
;
}
struct
vfsmount
*
vfsmntlist
=
NULL
;
static
struct
vfsmount
*
vfsmnttail
=
NULL
,
*
mru_vfsmnt
=
NULL
;
/*
* This part handles the management of the list of mounted filesystems.
*/
struct
vfsmount
*
lookup_vfsmnt
(
kdev_t
dev
)
{
struct
vfsmount
*
lptr
;
if
(
vfsmntlist
==
NULL
)
return
NULL
;
if
(
mru_vfsmnt
!=
NULL
&&
mru_vfsmnt
->
mnt_dev
==
dev
)
return
(
mru_vfsmnt
);
for
(
lptr
=
vfsmntlist
;
lptr
!=
NULL
;
lptr
=
lptr
->
mnt_next
)
if
(
lptr
->
mnt_dev
==
dev
)
{
mru_vfsmnt
=
lptr
;
return
(
lptr
);
}
return
NULL
;
}
static
struct
vfsmount
*
add_vfsmnt
(
struct
super_block
*
sb
,
const
char
*
dev_name
,
const
char
*
dir_name
)
{
...
...
@@ -286,11 +263,6 @@ static struct vfsmount *add_vfsmnt(struct super_block *sb,
lptr
->
mnt_sb
=
sb
;
lptr
->
mnt_dev
=
sb
->
s_dev
;
lptr
->
mnt_flags
=
sb
->
s_flags
;
sema_init
(
&
lptr
->
mnt_dquot
.
dqio_sem
,
1
);
sema_init
(
&
lptr
->
mnt_dquot
.
dqoff_sem
,
1
);
lptr
->
mnt_dquot
.
flags
=
0
;
/* N.B. Is it really OK to have a vfsmount without names? */
if
(
dev_name
&&
!
IS_ERR
(
tmp
=
getname
(
dev_name
)))
{
...
...
@@ -399,9 +371,9 @@ int get_filesystem_info( char *buf )
len
+=
sprintf
(
buf
+
len
,
"%s %s %s %s"
,
tmp
->
mnt_devname
,
path
,
tmp
->
mnt_sb
->
s_type
->
name
,
tmp
->
mnt_flags
&
MS_RDONLY
?
"ro"
:
"rw"
);
tmp
->
mnt_
sb
->
s_
flags
&
MS_RDONLY
?
"ro"
:
"rw"
);
for
(
fs_infop
=
fs_info
;
fs_infop
->
flag
;
fs_infop
++
)
{
if
(
tmp
->
mnt_flags
&
fs_infop
->
flag
)
{
if
(
tmp
->
mnt_
sb
->
s_
flags
&
fs_infop
->
flag
)
{
strcpy
(
buf
+
len
,
fs_infop
->
str
);
len
+=
strlen
(
fs_infop
->
str
);
}
...
...
@@ -592,6 +564,9 @@ static struct super_block * read_super(kdev_t dev, struct block_device *bdev,
sema_init
(
&
s
->
s_vfs_rename_sem
,
1
);
sema_init
(
&
s
->
s_nfsd_free_path_sem
,
1
);
s
->
s_type
=
type
;
sema_init
(
&
s
->
s_dquot
.
dqio_sem
,
1
);
sema_init
(
&
s
->
s_dquot
.
dqoff_sem
,
1
);
s
->
s_dquot
.
flags
=
0
;
lock_super
(
s
);
if
(
!
type
->
read_super
(
s
,
data
,
silent
))
goto
out_fail
;
...
...
@@ -688,7 +663,7 @@ static struct block_device *do_umount(kdev_t dev, int unmount_root, int flags)
* on the device. If the umount fails, too bad -- there
* are no quotas running any more. Just turn them on again.
*/
DQUOT_OFF
(
dev
);
DQUOT_OFF
(
sb
);
acct_auto_close
(
dev
);
/*
...
...
@@ -990,7 +965,6 @@ int do_mount(struct block_device *bdev, const char *dev_name,
static
int
do_remount_sb
(
struct
super_block
*
sb
,
int
flags
,
char
*
data
)
{
int
retval
;
struct
vfsmount
*
vfsmnt
;
if
(
!
(
flags
&
MS_RDONLY
)
&&
sb
->
s_dev
&&
is_read_only
(
sb
->
s_dev
))
return
-
EACCES
;
...
...
@@ -1007,9 +981,6 @@ static int do_remount_sb(struct super_block *sb, int flags, char *data)
return
retval
;
}
sb
->
s_flags
=
(
sb
->
s_flags
&
~
MS_RMT_MASK
)
|
(
flags
&
MS_RMT_MASK
);
vfsmnt
=
lookup_vfsmnt
(
sb
->
s_dev
);
if
(
vfsmnt
)
vfsmnt
->
mnt_flags
=
sb
->
s_flags
;
/*
* Invalidate the inodes, as some mount options may be changed.
...
...
include/linux/fs.h
View file @
1eafe709
...
...
@@ -589,6 +589,7 @@ struct super_block {
struct
list_head
s_files
;
struct
block_device
*
s_bdev
;
struct
quota_mount_options
s_dquot
;
/* Diskquota specific options */
union
{
struct
minix_sb_info
minix_sb
;
...
...
@@ -821,7 +822,7 @@ extern int do_truncate(struct dentry *, loff_t start);
extern
int
get_unused_fd
(
void
);
extern
void
put_unused_fd
(
unsigned
int
);
extern
struct
file
*
filp_open
(
const
char
*
,
int
,
int
);
extern
struct
file
*
filp_open
(
const
char
*
,
int
,
int
,
struct
dentry
*
);
extern
int
filp_close
(
struct
file
*
,
fl_owner_t
id
);
extern
char
*
getname
(
const
char
*
);
...
...
@@ -936,10 +937,15 @@ extern int notify_change(struct dentry *, struct iattr *);
extern
int
permission
(
struct
inode
*
,
int
);
extern
int
get_write_access
(
struct
inode
*
);
extern
void
put_write_access
(
struct
inode
*
);
extern
struct
dentry
*
open_namei
(
const
char
*
,
int
,
int
);
extern
struct
dentry
*
do_mknod
(
const
char
*
,
int
,
dev_t
);
extern
int
do_pipe
(
int
*
);
extern
int
do_unlink
(
const
char
*
name
);
extern
int
do_unlink
(
const
char
*
name
,
struct
dentry
*
);
extern
struct
dentry
*
__open_namei
(
const
char
*
,
int
,
int
,
struct
dentry
*
);
static
inline
struct
dentry
*
open_namei
(
const
char
*
pathname
)
{
return
__open_namei
(
pathname
,
0
,
0
,
NULL
);
}
/* fs/dcache.c -- generic fs support functions */
extern
int
is_subdir
(
struct
dentry
*
,
struct
dentry
*
);
...
...
include/linux/mount.h
View file @
1eafe709
...
...
@@ -30,14 +30,10 @@ struct vfsmount
kdev_t
mnt_dev
;
/* Device this applies to */
char
*
mnt_devname
;
/* Name of device e.g. /dev/dsk/hda1 */
char
*
mnt_dirname
;
/* Name of directory mounted on */
unsigned
int
mnt_flags
;
/* Flags of this device */
struct
super_block
*
mnt_sb
;
/* pointer to superblock */
struct
quota_mount_options
mnt_dquot
;
/* Diskquota specific mount options */
struct
vfsmount
*
mnt_next
;
/* pointer to next in linkedlist */
};
struct
vfsmount
*
lookup_vfsmnt
(
kdev_t
dev
);
/*
* Umount options
*/
...
...
include/linux/quota.h
View file @
1eafe709
...
...
@@ -174,7 +174,7 @@ struct dquot {
int
dq_count
;
/* Reference count */
/* fields after this point are cleared when invalidating */
struct
vfsmount
*
dq_mnt
;
/* VFS_mount_point
this applies to */
struct
super_block
*
dq_sb
;
/* superblock
this applies to */
unsigned
int
dq_id
;
/* ID this applies to (uid, gid) */
kdev_t
dq_dev
;
/* Device this applies to */
short
dq_type
;
/* Type of quota */
...
...
include/linux/quotaops.h
View file @
1eafe709
...
...
@@ -20,7 +20,7 @@
extern
void
dquot_initialize
(
struct
inode
*
inode
,
short
type
);
extern
void
dquot_drop
(
struct
inode
*
inode
);
extern
void
invalidate_dquots
(
kdev_t
dev
,
short
type
);
extern
int
quota_off
(
kdev_t
dev
,
short
type
);
extern
int
quota_off
(
struct
super_block
*
sb
,
short
type
);
extern
int
sync_dquots
(
kdev_t
dev
,
short
type
);
extern
int
dquot_alloc_block
(
const
struct
inode
*
inode
,
unsigned
long
number
,
char
prealloc
);
...
...
@@ -103,7 +103,7 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr)
}
#define DQUOT_SYNC(dev) sync_dquots(dev, -1)
#define DQUOT_OFF(
dev) quota_off(dev
, -1)
#define DQUOT_OFF(
sb) quota_off(sb
, -1)
#else
...
...
@@ -118,7 +118,7 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr)
#define DQUOT_FREE_BLOCK(sb, inode, nr) do { } while(0)
#define DQUOT_FREE_INODE(sb, inode) do { } while(0)
#define DQUOT_SYNC(dev) do { } while(0)
#define DQUOT_OFF(
dev
) do { } while(0)
#define DQUOT_OFF(
sb
) do { } while(0)
/*
* Special case expands to a simple notify_change.
...
...
ipc/shm.c
View file @
1eafe709
...
...
@@ -18,10 +18,8 @@
* 1) It only can handle one directory.
* 2) Because the directory is represented by the SYSV shm array it
* can only be mounted one time.
* 3) This again leads to SYSV shm not working properly in a chrooted
* environment
* 4) Read and write are not implemented (should they?)
* 5) No special nodes are supported
* 3) Read and write are not implemented (should they?)
* 4) No special nodes are supported
*/
#include <linux/config.h>
...
...
@@ -57,8 +55,6 @@ static void shm_delete (struct inode *);
static
int
shm_mmap
(
struct
file
*
,
struct
vm_area_struct
*
);
static
int
shm_readdir
(
struct
file
*
,
void
*
,
filldir_t
);
char
shm_path
[
256
]
=
"/var/shm"
;
#define SHM_NAME_LEN NAME_MAX
#define SHM_FMT ".IPC_%08x"
#define SHM_FMT_LEN 13
...
...
@@ -71,7 +67,6 @@ struct shmid_kernel /* private to the kernel */
unsigned
long
shm_npages
;
/* size of segment (pages) */
pte_t
**
shm_dir
;
/* ptr to arr of ptrs to frames */
int
id
;
int
destroyed
;
/* set if the final detach kills */
union
permap
{
struct
shmem
{
time_t
atime
;
...
...
@@ -116,7 +111,6 @@ static int newseg (key_t key, const char *name, int namelen, int shmflg, size_t
static
void
killseg_core
(
struct
shmid_kernel
*
shp
,
int
doacc
);
static
void
shm_open
(
struct
vm_area_struct
*
shmd
);
static
void
shm_close
(
struct
vm_area_struct
*
shmd
);
static
void
shm_remove_name
(
int
id
);
static
struct
page
*
shm_nopage
(
struct
vm_area_struct
*
,
unsigned
long
,
int
);
static
int
shm_swapout
(
struct
page
*
,
struct
file
*
);
#ifdef CONFIG_PROC_FS
...
...
@@ -312,20 +306,6 @@ static int shm_remount_fs (struct super_block *sb, int *flags, char *data)
return
0
;
}
static
struct
fs_struct
*
shm_push_root
(
void
)
{
struct
fs_struct
*
old
,
*
new
;
new
=
init_task_union
.
task
.
fs
;
old
=
current
->
fs
;
current
->
fs
=
new
;
return
old
;
}
static
void
shm_pop_root
(
struct
fs_struct
*
saved
)
{
current
->
fs
=
saved
;
}
static
void
shm_put_super
(
struct
super_block
*
sb
)
{
struct
super_block
**
p
=
&
shm_sb
;
...
...
@@ -893,17 +873,6 @@ static inline unsigned long copy_shminfo_to_user(void *buf, struct shminfo64 *in
}
}
char
*
shm_getname
(
int
id
)
{
char
*
result
;
if
(
!
(
result
=
__getname
()))
return
ERR_PTR
(
-
ENOMEM
);
sprintf
(
result
,
"%s/"
SHM_FMT
,
shm_path
,
id
);
return
result
;
}
asmlinkage
long
sys_shmctl
(
int
shmid
,
int
cmd
,
struct
shmid_ds
*
buf
)
{
struct
shm_setbuf
setbuf
;
...
...
@@ -1033,36 +1002,15 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
}
case
IPC_RMID
:
{
/*
* We cannot simply remove the file. The SVID states
* that the block remains until the last person
* detaches from it, then is deleted. A shmat() on
* an RMID segment is legal in older Linux and if
* we change it apps break...
*
* Instead we set a destroyed flag, and then blow
* the name away when the usage hits zero.
*/
char
name
[
SHM_FMT_LEN
+
1
];
if
((
shmid
%
SEQ_MULTIPLIER
)
==
zero_id
)
return
-
EINVAL
;
sprintf
(
name
,
SHM_FMT
,
shmid
);
lock_kernel
();
shp
=
shm_lock
(
shmid
);
if
(
shp
==
NULL
)
{
unlock_kernel
();
return
-
EINVAL
;
}
err
=-
EIDRM
;
if
(
shm_checkid
(
shp
,
shmid
)
==
0
)
{
if
(
shp
->
shm_nattch
==
0
)
shm_remove_name
(
shmid
);
else
shp
->
destroyed
=
1
;
err
=
0
;
}
shm_unlock
(
shmid
);
err
=
do_unlink
(
name
,
dget
(
shm_sb
->
s_root
));
unlock_kernel
();
if
(
err
==
-
ENOENT
)
err
=
-
EINVAL
;
return
err
;
}
...
...
@@ -1141,8 +1089,7 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
struct
file
*
file
;
int
err
;
int
flags
;
char
*
name
;
struct
fs_struct
*
saved
;
char
name
[
SHM_FMT_LEN
+
1
];
if
(
!
shm_sb
||
(
shmid
%
SEQ_MULTIPLIER
)
==
zero_id
)
return
-
EINVAL
;
...
...
@@ -1159,19 +1106,13 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
}
else
flags
=
MAP_SHARED
;
name
=
shm_getname
(
shmid
);
if
(
IS_ERR
(
name
))
return
PTR_ERR
(
name
);
sprintf
(
name
,
SHM_FMT
,
shmid
);
lock_kernel
();
saved
=
shm_push_root
();
file
=
filp_open
(
name
,
O_RDWR
,
0
);
shm_pop_root
(
saved
);
putname
(
name
);
if
(
IS_ERR
(
file
))
file
=
filp_open
(
name
,
O_RDWR
,
0
,
dget
(
shm_sb
->
s_root
));
if
(
IS_ERR
(
file
))
{
unlock_kernel
();
goto
bad_file
;
}
*
raddr
=
do_mmap
(
file
,
addr
,
file
->
f_dentry
->
d_inode
->
i_size
,
(
shmflg
&
SHM_RDONLY
?
PROT_READ
:
PROT_READ
|
PROT_WRITE
),
flags
,
0
);
...
...
@@ -1184,7 +1125,6 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
return
err
;
bad_file:
unlock_kernel
();
if
((
err
=
PTR_ERR
(
file
))
==
-
ENOENT
)
return
-
EINVAL
;
return
err
;
...
...
@@ -1196,23 +1136,6 @@ static void shm_open (struct vm_area_struct *shmd)
shm_inc
(
shmd
->
vm_file
->
f_dentry
->
d_inode
->
i_ino
);
}
/*
* Remove a name. Must be called with lock_kernel
*/
static
void
shm_remove_name
(
int
id
)
{
char
*
name
=
shm_getname
(
id
);
if
(
!
IS_ERR
(
name
))
{
struct
fs_struct
*
saved
;
saved
=
shm_push_root
();
do_unlink
(
name
);
shm_pop_root
(
saved
);
putname
(
name
);
}
}
/*
* remove the attach descriptor shmd.
* free memory for segment if it is marked destroyed.
...
...
@@ -1230,14 +1153,7 @@ static void shm_close (struct vm_area_struct *shmd)
shp
->
shm_lprid
=
current
->
pid
;
shp
->
shm_dtim
=
CURRENT_TIME
;
shp
->
shm_nattch
--
;
if
(
shp
->
shm_nattch
==
0
&&
shp
->
destroyed
)
{
shp
->
destroyed
=
0
;
shm_remove_name
(
id
);
shm_unlock
(
id
);
}
else
shm_unlock
(
id
);
shm_unlock
(
id
);
}
/*
...
...
kernel/acct.c
View file @
1eafe709
...
...
@@ -154,7 +154,7 @@ asmlinkage long sys_acct(const char *name)
if
(
IS_ERR
(
tmp
))
goto
out
;
/* Difference from BSD - they don't do O_APPEND */
file
=
filp_open
(
tmp
,
O_WRONLY
|
O_APPEND
,
0
);
file
=
filp_open
(
tmp
,
O_WRONLY
|
O_APPEND
,
0
,
NULL
);
putname
(
tmp
);
if
(
IS_ERR
(
file
))
{
error
=
PTR_ERR
(
file
);
...
...
kernel/ksyms.c
View file @
1eafe709
...
...
@@ -141,7 +141,7 @@ EXPORT_SYMBOL(iget4);
EXPORT_SYMBOL
(
iput
);
EXPORT_SYMBOL
(
__namei
);
EXPORT_SYMBOL
(
lookup_dentry
);
EXPORT_SYMBOL
(
open_namei
);
EXPORT_SYMBOL
(
__
open_namei
);
EXPORT_SYMBOL
(
sys_close
);
EXPORT_SYMBOL
(
d_alloc_root
);
EXPORT_SYMBOL
(
d_delete
);
...
...
kernel/sysctl.c
View file @
1eafe709
...
...
@@ -57,7 +57,6 @@ extern int sg_big_buff;
#endif
#ifdef CONFIG_SYSVIPC
extern
size_t
shm_ctlmax
;
extern
char
shm_path
[];
extern
int
msg_ctlmax
;
extern
int
msg_ctlmnb
;
extern
int
msg_ctlmni
;
...
...
@@ -199,8 +198,6 @@ static ctl_table kern_table[] = {
{
KERN_RTSIGMAX
,
"rtsig-max"
,
&
max_queued_signals
,
sizeof
(
int
),
0644
,
NULL
,
&
proc_dointvec
},
#ifdef CONFIG_SYSVIPC
{
KERN_SHMPATH
,
"shmpath"
,
&
shm_path
,
256
,
0644
,
NULL
,
&
proc_dostring
,
&
sysctl_string
},
{
KERN_SHMMAX
,
"shmmax"
,
&
shm_ctlmax
,
sizeof
(
size_t
),
0644
,
NULL
,
&
proc_doulongvec_minmax
},
{
KERN_MSGMAX
,
"msgmax"
,
&
msg_ctlmax
,
sizeof
(
int
),
...
...
net/unix/af_unix.c
View file @
1eafe709
...
...
@@ -569,7 +569,7 @@ static unix_socket *unix_find_other(struct sockaddr_un *sunname, int len,
/* Do not believe to VFS, grab kernel lock */
lock_kernel
();
dentry
=
open_namei
(
sunname
->
sun_path
,
2
|
O_NOFOLLOW
,
S_IFSOCK
);
dentry
=
__open_namei
(
sunname
->
sun_path
,
2
|
O_NOFOLLOW
,
S_IFSOCK
,
NULL
);
if
(
IS_ERR
(
dentry
))
{
*
error
=
PTR_ERR
(
dentry
);
unlock_kernel
();
...
...
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