From: Jeff Dike This patch includes the following - updated defconfig move uml.lds.S and main.c from arch/um to arch/um/kernel per Sam's suggestions steal bitops.c from arch/i386 convert all calls to open_private_file to dentry_open Signed-off-by: Andrew Morton --- 25-akpm/arch/um/Makefile | 13 -- 25-akpm/arch/um/defconfig | 9 - 25-akpm/arch/um/kernel/Makefile | 6 25-akpm/arch/um/kernel/main.c | 230 ++++++++++++++++++++++++++++++++++++++ 25-akpm/arch/um/kernel/uml.lds.S | 96 +++++++++++++++ 25-akpm/arch/um/main.c | 230 -------------------------------------- 25-akpm/arch/um/sys-i386/Makefile | 7 - 25-akpm/arch/um/uml.lds.S | 96 --------------- 25-akpm/fs/hppfs/hppfs_kern.c | 38 +++--- 9 files changed, 362 insertions(+), 363 deletions(-) diff -puN arch/um/defconfig~make-uml-build-and-run arch/um/defconfig --- 25/arch/um/defconfig~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/defconfig Fri Aug 20 15:30:02 2004 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.8.1-mm1 -# Mon Aug 16 22:34:07 2004 +# Linux kernel version: 2.6.8.1-mm3 +# Fri Aug 20 13:03:03 2004 # CONFIG_USERMODE=y CONFIG_MMU=y @@ -43,7 +43,6 @@ CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set -# CONFIG_PAGG is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 @@ -55,6 +54,7 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y +# CONFIG_CPUSETS is not set CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y @@ -236,6 +236,9 @@ CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT3_FS is not set # CONFIG_JBD is not set +CONFIG_REISER4_FS=y +CONFIG_REISER4_LARGE_KEY=y +# CONFIG_REISER4_CHECK is not set CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set diff -puN arch/um/kernel/main.c~make-uml-build-and-run arch/um/kernel/main.c --- 25/arch/um/kernel/main.c~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/kernel/main.c Fri Aug 20 15:30:02 2004 @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "user_util.h" +#include "kern_util.h" +#include "mem_user.h" +#include "signal_user.h" +#include "user.h" +#include "init.h" +#include "mode.h" +#include "choose-mode.h" +#include "uml-config.h" + +/* Set in set_stklim, which is called from main and __wrap_malloc. + * __wrap_malloc only calls it if main hasn't started. + */ +unsigned long stacksizelim; + +/* Set in main */ +char *linux_prog; + +#define PGD_BOUND (4 * 1024 * 1024) +#define STACKSIZE (8 * 1024 * 1024) +#define THREAD_NAME_LEN (256) + +static void set_stklim(void) +{ + struct rlimit lim; + + if(getrlimit(RLIMIT_STACK, &lim) < 0){ + perror("getrlimit"); + exit(1); + } + if((lim.rlim_cur == RLIM_INFINITY) || (lim.rlim_cur > STACKSIZE)){ + lim.rlim_cur = STACKSIZE; + if(setrlimit(RLIMIT_STACK, &lim) < 0){ + perror("setrlimit"); + exit(1); + } + } + stacksizelim = (lim.rlim_cur + PGD_BOUND - 1) & ~(PGD_BOUND - 1); +} + +static __init void do_uml_initcalls(void) +{ + initcall_t *call; + + call = &__uml_initcall_start; + while (call < &__uml_initcall_end){; + (*call)(); + call++; + } +} + +static void last_ditch_exit(int sig) +{ + CHOOSE_MODE(kmalloc_ok = 0, (void) 0); + signal(SIGINT, SIG_DFL); + signal(SIGTERM, SIG_DFL); + signal(SIGHUP, SIG_DFL); + uml_cleanup(); + exit(1); +} + +extern int uml_exitcode; + +int main(int argc, char **argv, char **envp) +{ + char **new_argv; + sigset_t mask; + int ret, i; + + /* Enable all signals except SIGIO - in some environments, we can + * enter with some signals blocked + */ + + sigemptyset(&mask); + sigaddset(&mask, SIGIO); + if(sigprocmask(SIG_SETMASK, &mask, NULL) < 0){ + perror("sigprocmask"); + exit(1); + } + +#ifdef UML_CONFIG_MODE_TT + /* Allocate memory for thread command lines */ + if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){ + + char padding[THREAD_NAME_LEN] = { + [ 0 ... THREAD_NAME_LEN - 2] = ' ', '\0' + }; + + new_argv = malloc((argc + 2) * sizeof(char*)); + if(!new_argv) { + perror("Allocating extended argv"); + exit(1); + } + + new_argv[0] = argv[0]; + new_argv[1] = padding; + + for(i = 2; i <= argc; i++) + new_argv[i] = argv[i - 1]; + new_argv[argc + 1] = NULL; + + execvp(new_argv[0], new_argv); + perror("execing with extended args"); + exit(1); + } +#endif + + linux_prog = argv[0]; + + set_stklim(); + + new_argv = malloc((argc + 1) * sizeof(char *)); + if(new_argv == NULL){ + perror("Mallocing argv"); + exit(1); + } + for(i=0;i= uml_physmem) && (addr <= high_physmem)) + kfree(ptr); + else if((addr >= start_vm) && (addr <= end_vm)) + vfree(ptr); + else + __real_free(ptr); + } + else __real_free(ptr); +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN arch/um/kernel/Makefile~make-uml-build-and-run arch/um/kernel/Makefile --- 25/arch/um/kernel/Makefile~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/kernel/Makefile Fri Aug 20 15:30:02 2004 @@ -3,10 +3,10 @@ # Licensed under the GPL # -extra-y := vmlinux.lds +extra-y := vmlinux.lds uml.lds obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ - helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ + helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ physmem.o process.o process_kern.o ptrace.o reboot.o resource.o \ sigio_user.o sigio_kern.o signal_kern.o signal_user.o smp.o \ syscall_kern.o syscall_user.o sysrq.o sys_call_table.o tempfile.o \ @@ -24,7 +24,7 @@ obj-$(CONFIG_MODE_SKAS) += skas/ user-objs-$(CONFIG_TTY_LOG) += tty_log.o USER_OBJS := $(filter %_user.o,$(obj-y)) $(user-objs-y) config.o helper.o \ - process.o tempfile.o time.o tty_log.o umid.o user_util.o + main.o process.o tempfile.o time.o tty_log.o umid.o user_util.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS)) diff -puN arch/um/kernel/uml.lds.S~make-uml-build-and-run arch/um/kernel/uml.lds.S --- 25/arch/um/kernel/uml.lds.S~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/kernel/uml.lds.S Fri Aug 20 15:30:02 2004 @@ -0,0 +1,96 @@ +#include + +OUTPUT_FORMAT(ELF_FORMAT) +OUTPUT_ARCH(ELF_ARCH) +ENTRY(_start) +jiffies = jiffies_64; + +SECTIONS +{ + . = START + SIZEOF_HEADERS; + + __binary_start = .; +#ifdef MODE_TT + .thread_private : { + __start_thread_private = .; + errno = .; + . += 4; + arch/um/kernel/tt/unmap_fin.o (.data) + __end_thread_private = .; + } + . = ALIGN(4096); + .remap : { arch/um/kernel/tt/unmap_fin.o (.text) } +#endif + + . = ALIGN(4096); /* Init code and data */ + _stext = .; + __init_begin = .; + .init.text : { + _sinittext = .; + *(.init.text) + _einittext = .; + } + . = ALIGN(4096); + .text : + { + *(.text) + SCHED_TEXT + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } + + #include "asm/common.lds.S" + + init.data : { *(init.data) } + .data : + { + . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ + *(.data.init_task) + *(.data) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + .ctors : + { + *(.ctors) + } + .dtors : + { + *(.dtors) + } + + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) } + _edata = .; + PROVIDE (edata = .); + . = ALIGN(0x1000); + .sbss : + { + __bss_start = .; + PROVIDE(_bss_start = .); + *(.sbss) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + } + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } +} diff -puN arch/um/main.c~make-uml-build-and-run arch/um/main.c --- 25/arch/um/main.c~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/main.c Fri Aug 20 15:30:02 2004 @@ -1,230 +0,0 @@ -/* - * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "user_util.h" -#include "kern_util.h" -#include "mem_user.h" -#include "signal_user.h" -#include "user.h" -#include "init.h" -#include "mode.h" -#include "choose-mode.h" -#include "uml-config.h" - -/* Set in set_stklim, which is called from main and __wrap_malloc. - * __wrap_malloc only calls it if main hasn't started. - */ -unsigned long stacksizelim; - -/* Set in main */ -char *linux_prog; - -#define PGD_BOUND (4 * 1024 * 1024) -#define STACKSIZE (8 * 1024 * 1024) -#define THREAD_NAME_LEN (256) - -static void set_stklim(void) -{ - struct rlimit lim; - - if(getrlimit(RLIMIT_STACK, &lim) < 0){ - perror("getrlimit"); - exit(1); - } - if((lim.rlim_cur == RLIM_INFINITY) || (lim.rlim_cur > STACKSIZE)){ - lim.rlim_cur = STACKSIZE; - if(setrlimit(RLIMIT_STACK, &lim) < 0){ - perror("setrlimit"); - exit(1); - } - } - stacksizelim = (lim.rlim_cur + PGD_BOUND - 1) & ~(PGD_BOUND - 1); -} - -static __init void do_uml_initcalls(void) -{ - initcall_t *call; - - call = &__uml_initcall_start; - while (call < &__uml_initcall_end){; - (*call)(); - call++; - } -} - -static void last_ditch_exit(int sig) -{ - CHOOSE_MODE(kmalloc_ok = 0, (void) 0); - signal(SIGINT, SIG_DFL); - signal(SIGTERM, SIG_DFL); - signal(SIGHUP, SIG_DFL); - uml_cleanup(); - exit(1); -} - -extern int uml_exitcode; - -int main(int argc, char **argv, char **envp) -{ - char **new_argv; - sigset_t mask; - int ret, i; - - /* Enable all signals except SIGIO - in some environments, we can - * enter with some signals blocked - */ - - sigemptyset(&mask); - sigaddset(&mask, SIGIO); - if(sigprocmask(SIG_SETMASK, &mask, NULL) < 0){ - perror("sigprocmask"); - exit(1); - } - -#ifdef UML_CONFIG_MODE_TT - /* Allocate memory for thread command lines */ - if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){ - - char padding[THREAD_NAME_LEN] = { - [ 0 ... THREAD_NAME_LEN - 2] = ' ', '\0' - }; - - new_argv = malloc((argc + 2) * sizeof(char*)); - if(!new_argv) { - perror("Allocating extended argv"); - exit(1); - } - - new_argv[0] = argv[0]; - new_argv[1] = padding; - - for(i = 2; i <= argc; i++) - new_argv[i] = argv[i - 1]; - new_argv[argc + 1] = NULL; - - execvp(new_argv[0], new_argv); - perror("execing with extended args"); - exit(1); - } -#endif - - linux_prog = argv[0]; - - set_stklim(); - - new_argv = malloc((argc + 1) * sizeof(char *)); - if(new_argv == NULL){ - perror("Mallocing argv"); - exit(1); - } - for(i=0;i= uml_physmem) && (addr <= high_physmem)) - kfree(ptr); - else if((addr >= start_vm) && (addr <= end_vm)) - vfree(ptr); - else - __real_free(ptr); - } - else __real_free(ptr); -} - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff -puN arch/um/Makefile~make-uml-build-and-run arch/um/Makefile --- 25/arch/um/Makefile~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/Makefile Fri Aug 20 15:30:02 2004 @@ -86,8 +86,6 @@ prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) LDFLAGS_vmlinux = -r -vmlinux: $(ARCH_DIR)/main.o - # These aren't in Makefile-tt because they are needed in the !CONFIG_MODE_TT + # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. @@ -120,14 +118,11 @@ CPPFLAGS_vmlinux.lds = $(shell echo -U$( export CPPFLAGS_$(LD_SCRIPT-y) = $(CPPFLAGS_vmlinux.lds) -P -C -Uum -LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) - -#$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE -# $(call if_changed_dep,as_s_S) +LD_SCRIPT-y := $(ARCH_DIR)/kernel/$(LD_SCRIPT-y) linux: vmlinux $(LD_SCRIPT-y) $(CC) -Wl,-T,$(LD_SCRIPT-y) $(LINK-y) $(LINK_WRAPS) \ - -o linux $(ARCH_DIR)/main.o vmlinux -L/usr/lib -lutil + -o linux vmlinux -L/usr/lib -lutil USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS)) @@ -162,10 +157,6 @@ CLEAN_FILES += linux x.i gmon.out $(ARCH MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) -$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c sys_prepare - @ echo ' MAIN $@' - @ $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< - archmrproper: @: diff -puN arch/um/sys-i386/Makefile~make-uml-build-and-run arch/um/sys-i386/Makefile --- 25/arch/um/sys-i386/Makefile~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/sys-i386/Makefile Fri Aug 20 15:30:02 2004 @@ -1,5 +1,5 @@ -obj-y = bugs.o checksum.o fault.o ksyms.o ldt.o ptrace.o ptrace_user.o \ - semaphore.o sigcontext.o syscalls.o sysrq.o time.o +obj-y = bitops.o bugs.o checksum.o fault.o ksyms.o ldt.o ptrace.o \ + ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o time.o obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_MODULES) += module.o @@ -7,11 +7,12 @@ obj-$(CONFIG_MODULES) += module.o USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) -SYMLINKS = semaphore.c highmem.c module.c +SYMLINKS = bitops.c semaphore.c highmem.c module.c SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f) clean-files := $(SYMLINKS) +bitops.c-dir = lib semaphore.c-dir = kernel highmem.c-dir = mm module.c-dir = kernel diff -puN arch/um/uml.lds.S~make-uml-build-and-run arch/um/uml.lds.S --- 25/arch/um/uml.lds.S~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/arch/um/uml.lds.S Fri Aug 20 15:30:02 2004 @@ -1,96 +0,0 @@ -#include - -OUTPUT_FORMAT(ELF_FORMAT) -OUTPUT_ARCH(ELF_ARCH) -ENTRY(_start) -jiffies = jiffies_64; - -SECTIONS -{ - . = START + SIZEOF_HEADERS; - - __binary_start = .; -#ifdef MODE_TT - .thread_private : { - __start_thread_private = .; - errno = .; - . += 4; - arch/um/kernel/tt/unmap_fin.o (.data) - __end_thread_private = .; - } - . = ALIGN(4096); - .remap : { arch/um/kernel/tt/unmap_fin.o (.text) } -#endif - - . = ALIGN(4096); /* Init code and data */ - _stext = .; - __init_begin = .; - .init.text : { - _sinittext = .; - *(.init.text) - _einittext = .; - } - . = ALIGN(4096); - .text : - { - *(.text) - SCHED_TEXT - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } - - #include "asm/common.lds.S" - - init.data : { *(init.data) } - .data : - { - . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ - *(.data.init_task) - *(.data) - *(.gnu.linkonce.d*) - CONSTRUCTORS - } - .data1 : { *(.data1) } - .ctors : - { - *(.ctors) - } - .dtors : - { - *(.dtors) - } - - .got : { *(.got.plt) *(.got) } - .dynamic : { *(.dynamic) } - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } - _edata = .; - PROVIDE (edata = .); - . = ALIGN(0x1000); - .sbss : - { - __bss_start = .; - PROVIDE(_bss_start = .); - *(.sbss) - *(.scommon) - } - .bss : - { - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = . ; - PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } -} diff -puN fs/hppfs/hppfs_kern.c~make-uml-build-and-run fs/hppfs/hppfs_kern.c --- 25/fs/hppfs/hppfs_kern.c~make-uml-build-and-run Fri Aug 20 15:30:02 2004 +++ 25-akpm/fs/hppfs/hppfs_kern.c Fri Aug 20 15:30:02 2004 @@ -24,7 +24,7 @@ struct hppfs_data { }; struct hppfs_private { - struct file proc_file; + struct file *proc_file; int host_fd; loff_t len; struct hppfs_data *contents; @@ -307,7 +307,7 @@ static ssize_t hppfs_read(struct file *f if(count > 0) *ppos += count; } - else count = read_proc(&hppfs->proc_file, buf, count, ppos, 1); + else count = read_proc(hppfs->proc_file, buf, count, ppos, 1); return(count); } @@ -316,7 +316,7 @@ static ssize_t hppfs_write(struct file * loff_t *ppos) { struct hppfs_private *data = file->private_data; - struct file *proc_file = &data->proc_file; + struct file *proc_file = data->proc_file; ssize_t (*write)(struct file *, const char *, size_t, loff_t *); int err; @@ -471,9 +471,10 @@ static int hppfs_open(struct inode *inod proc_dentry = HPPFS_I(inode)->proc_dentry; /* XXX This isn't closed anywhere */ - err = open_private_file(&data->proc_file, proc_dentry, - file_mode(file->f_mode)); - if(err) + data->proc_file = dentry_open(dget(proc_dentry), NULL, + file_mode(file->f_mode)); + err = PTR_ERR(data->proc_file); + if(IS_ERR(data->proc_file)) goto out_free1; type = os_file_type(host_file); @@ -524,9 +525,10 @@ static int hppfs_dir_open(struct inode * goto out; proc_dentry = HPPFS_I(inode)->proc_dentry; - err = open_private_file(&data->proc_file, proc_dentry, - file_mode(file->f_mode)); - if(err) + data->proc_file = dentry_open(dget(proc_dentry), NULL, + file_mode(file->f_mode)); + err = PTR_ERR(data->proc_file); + if(IS_ERR(data->proc_file)) goto out_free; file->private_data = data; @@ -657,40 +659,42 @@ static struct super_operations hppfs_sbo static int hppfs_readlink(struct dentry *dentry, char *buffer, int buflen) { - struct file proc_file; + struct file *proc_file; struct dentry *proc_dentry; int (*readlink)(struct dentry *, char *, int); int err, n; proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; - err = open_private_file(&proc_file, proc_dentry, O_RDONLY); - if(err) + proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); + err = PTR_ERR(proc_dentry); + if(IS_ERR(proc_dentry)) return(err); readlink = proc_dentry->d_inode->i_op->readlink; n = (*readlink)(proc_dentry, buffer, buflen); - close_private_file(&proc_file); + fput(proc_file); return(n); } static int hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) { - struct file proc_file; + struct file *proc_file; struct dentry *proc_dentry; int (*follow_link)(struct dentry *, struct nameidata *); int err, n; proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; - err = open_private_file(&proc_file, proc_dentry, O_RDONLY); - if(err) + proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); + err = PTR_ERR(proc_dentry); + if(IS_ERR(proc_dentry)) return(err); follow_link = proc_dentry->d_inode->i_op->follow_link; n = (*follow_link)(proc_dentry, nd); - close_private_file(&proc_file); + fput(proc_file); return(n); } _