Commit 158c9de5 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.74

parent 97ccc379
...@@ -958,9 +958,10 @@ D: Busmaster driver for HP 10/100 Mbit Network Adapters ...@@ -958,9 +958,10 @@ D: Busmaster driver for HP 10/100 Mbit Network Adapters
S: University of Stuttgart, Germany and S: University of Stuttgart, Germany and
S: Ecole Nationale Superieure des Telecommunications, Paris S: Ecole Nationale Superieure des Telecommunications, Paris
N: Martin von Loewis N: Martin von Lwis
E: loewis@informatik.hu-berlin.de E: loewis@informatik.hu-berlin.de
D: script binary format D: script binary format
D: NTFS driver
N: Mark Lord N: Mark Lord
E: mlord@pobox.com E: mlord@pobox.com
......
...@@ -4749,6 +4749,20 @@ CONFIG_HPFS_FS ...@@ -4749,6 +4749,20 @@ CONFIG_HPFS_FS
want). The module is called hpfs.o. If you want to compile it as a want). The module is called hpfs.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt. If unsure, module, say M here and read Documentation/modules.txt. If unsure,
say N. say N.
Windows NT NTFS support (read only)
CONFIG_NTFS_FS
NTFS is the file system of Microsoft Windows NT. Say Y if you want
to access partitions using this file system. The Linux NTFS driver
supports most of the mount options of the VFAT driver, see
Documentation/filesystems/ntfs.txt. There is an experimental
write support available; use at your own risk.
NTFS read-write support (experimental)
CONFIG_NTFS_RW
The read-write support in NTFS is far from being complete and well
tested. If you enable this, be prepared to recover the NTFS volume
from tape.
System V and Coherent filesystem support System V and Coherent filesystem support
CONFIG_SYSV_FS CONFIG_SYSV_FS
......
NTFS Overview
=============
To mount an NTFS volume, use the filesystem type 'ntfs'. The driver
currently works only in read-only mode, with no fault-tolerance
supported. If you enable the experimental write support, make sure
you can recover from a complete loss of data. For ftdisk support,
limit success was reported with volume sets on top of the md driver,
although mirror and stripe sets should work as well - if the md
driver can be talked into using the same lay-out as Windows NT.
The ntfs driver supports the following mount options:
iocharset=name Character set to use when returning file names.
Unlike VFAT, NTFS suppresses names that contain
unconvertible characters
utf8=<bool> Use UTF-8 for converting file names
uni_xlate=<bool>,2 Use the VFAT-style encoding for file names outside
the current character set. A boolean value will
enable the feature, a value of 2 will enable the
encoding as documented in vfat.txt:
':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12),
uid=
gid=
umask= These options work as documented in mount(8).
By default, the files are owned by root and
not readable by somebody else.
posix=<bool> If enabled, the file system distinguishes between
upper and lower case. The 8.3 alias names are presented
as hard links instead of being suppressed.
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
Stallion Multiport Serial Driver Readme Stallion Multiport Serial Driver Readme
--------------------------------------- ---------------------------------------
Copyright (C) 1994-1997, Stallion Technologies (support@stallion.oz.au). Copyright (C) 1994-1997, Stallion Technologies (support@stallion.com).
Version: 5.3.4 Version: 5.4.1
Date: 15SEP97 Date: 19DEC97
...@@ -13,32 +13,36 @@ Date: 15SEP97 ...@@ -13,32 +13,36 @@ Date: 15SEP97
There are two drivers that work with the different families of Stallion There are two drivers that work with the different families of Stallion
multiport serial boards. One is for the Stallion smart boards - that is multiport serial boards. One is for the Stallion smart boards - that is
EasyIO and EasyConnection 8/32, the other for the true Stallion intelligent EasyIO, EasyConnection 8/32 and EasyConnection 8/64-PCI, the other for
multiport boards - EasyConnection 8/64, ONboard and Brumby. the true Stallion intelligent multiport boards - EasyConnection 8/64
(ISA and EISA), ONboard and Brumby.
If you are using any of the Stallion intelligent multiport boards (Brumby, If you are using any of the Stallion intelligent multiport boards (Brumby,
ONboard, EasyConnection 8/64) with Linux you will need to get the driver ONboard, EasyConnection 8/64 (ISA or EISA)) with Linux you will need to
utility package. This package is available at most of the Linux archive get the driver utility package. This package is available at most of the
sites (and on CD's that contain these archives). The file will be called Linux archive sites (and on CD's that contain these archives). The file
stallion-X.X.X.tar.gz where X.X.X will be the version number. In particular will be called stallion-X.X.X.tar.gz where X.X.X will be the version
this package contains the board embedded executable images that are number. In particular this package contains the board embedded executable
required for these boards. It also contains the downloader program. images that are required for these boards. It also contains the downloader
These boards cannot be used without this. program. These boards cannot be used without this.
The following ftp sites (and their mirrors) definitely have the stallion The Stallion Technologies ftp site, ftp.stallion.com, will always have
driver utility package: ftp.stallion.com, tsx-11.mit.edu, sunsite.unc.edu. the latest version of the driver utility package. Other sites that usually
have the latest version are tsx-11.mit.edu, sunsite.unc.edu and their
ftp.stallion.com:/drivers/ata5/Linux/stallion-5.3.1.tar.gz mirrors.
tsx-11.mit.edu:/pub/linux/BETA/serial/stallion/stallion-5.3.1.tar.gz
sunsite.unc.edu:/pub/Linux/kernel/patches/serial/stallion-5.3.1.tar.gz ftp.stallion.com:/drivers/ata5/Linux/stallion-5.4.0.tar.gz
tsx-11.mit.edu:/pub/linux/BETA/serial/stallion/stallion-5.4.0.tar.gz
sunsite.unc.edu:/pub/Linux/kernel/patches/serial/stallion-5.4.0.tar.gz
As of the printing of this document the latest version of the driver As of the printing of this document the latest version of the driver
utility package is 5.3.1. If a later version is now available then you utility package is 5.4.0. If a later version is now available then you
should use the latest version. should use the latest version.
If you are using the EasyIO or EasyConnection 8/32 boards then you don't If you are using the EasyIO, EasyConnection 8/32 or EasyConnection 8/64-PCI
need this package. Although it does have a handy script to create the boards then you don't need this package. Although it does have a handy
/dev device nodes for these boards, and a serial stats display program. script to create the /dev device nodes for these boards, and a serial stats
display program.
If you require DIP switch settings, EISA/MCA configuration files, or any If you require DIP switch settings, EISA/MCA configuration files, or any
other information related to Stallion boards then have a look at Stallion's other information related to Stallion boards then have a look at Stallion's
...@@ -63,7 +67,7 @@ the instructions below. Both drivers can support up to 4 boards. The smart ...@@ -63,7 +67,7 @@ the instructions below. Both drivers can support up to 4 boards. The smart
card driver (the stallion.c driver) supports any combination of EasyIO and card driver (the stallion.c driver) supports any combination of EasyIO and
EasyConnection 8/32 boards (up to a total of 4). The intelligent driver EasyConnection 8/32 boards (up to a total of 4). The intelligent driver
supports any combination of ONboards, Brumbys, Stallions and EasyConnection supports any combination of ONboards, Brumbys, Stallions and EasyConnection
8/64 boards (up to a total of 4). 8/64 (ISA and EISA) boards (up to a total of 4).
To set up the driver(s) for the boards that you want to use you need to To set up the driver(s) for the boards that you want to use you need to
edit the appropriate driver file and add configuration entries. edit the appropriate driver file and add configuration entries.
...@@ -76,7 +80,8 @@ If using EasyIO or EasyConnection 8/32 ISA or MCA boards, do: ...@@ -76,7 +80,8 @@ If using EasyIO or EasyConnection 8/32 ISA or MCA boards, do:
(the comments before this structure should help) (the comments before this structure should help)
- save and exit - save and exit
If using ONboard, Brumby, Stallion or EasyConnection 8/64 boards then do: If using ONboard, Brumby, Stallion or EasyConnection 8/64 (ISA or EISA)
boards then do:
vi /usr/src/linux/drivers/char/istallion.c vi /usr/src/linux/drivers/char/istallion.c
- find the definition of the stli_brdconf array (of structures) - find the definition of the stli_brdconf array (of structures)
near the top of the file near the top of the file
...@@ -114,11 +119,11 @@ do a couple of things: ...@@ -114,11 +119,11 @@ do a couple of things:
configuration files for *all* the EasyIO and EasyConnection 8/32 boards configuration files for *all* the EasyIO and EasyConnection 8/32 boards
that are sharing interrupts. The Stallion EasyIO and EasyConnection 8/32 that are sharing interrupts. The Stallion EasyIO and EasyConnection 8/32
EISA configuration files required are supplied by Stallion Technologies EISA configuration files required are supplied by Stallion Technologies
on the EASY Utilities floppy (usually supplied in the box with the board on the EASY Utilities floppy diskette (usually supplied in the box with
when purchased. If not, you can pick it up from Stallion's FTP site, the board when purchased. If not, you can pick it up from Stallion's FTP
ftp.stallion.com). You will need to edit the board resources to choose site, ftp.stallion.com). You will need to edit the board resources to
level triggered interrupts, and make sure to set each board's interrupt choose level triggered interrupts, and make sure to set each board's
to the same IRQ number. interrupt to the same IRQ number.
You must complete both the above steps for this to work. When you reboot You must complete both the above steps for this to work. When you reboot
or load the driver your EasyIO and EasyConnection 8/32 boards will be or load the driver your EasyIO and EasyConnection 8/32 boards will be
...@@ -149,8 +154,8 @@ modules, or change it on the board. On EasyIO and EasyConnection 8/32 boards ...@@ -149,8 +154,8 @@ modules, or change it on the board. On EasyIO and EasyConnection 8/32 boards
the IRQ is software programmable, so if there is a conflict you may need to the IRQ is software programmable, so if there is a conflict you may need to
change the IRQ used for a board in the stallion.c configuration structure. change the IRQ used for a board in the stallion.c configuration structure.
There are no interrupts to worry about for ONboard, Brumby or EasyConnection There are no interrupts to worry about for ONboard, Brumby or EasyConnection
8/64 boards. The memory region on EasyConnection 8/64 and ONboard boards is 8/64 (ISA, EISA and MCA) boards. The memory region on EasyConnection 8/64 and
software programmable, but not on the Brumby boards. ONboard boards is software programmable, but not on the Brumby boards.
......
...@@ -433,6 +433,13 @@ M: io8-linux@specialix.co.uk ...@@ -433,6 +433,13 @@ M: io8-linux@specialix.co.uk
L: linux-kernel@vger.rutgers.edu ? L: linux-kernel@vger.rutgers.edu ?
S: Supported S: Supported
STALLION TECHNOLOGIES MULTIPORT SERIAL BOARDS
P: Greg Ungerer
M: support@stallion.oz.au
M: gerg@stallion.com
W: http://www.stallion.com
S: Supported
MOUSE AND MISC DEVICES [GENERAL] MOUSE AND MISC DEVICES [GENERAL]
P: Alessandro Rubini P: Alessandro Rubini
M: rubini@ipvvis.unipv.it M: rubini@ipvvis.unipv.it
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 73 SUBLEVEL = 74
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
...@@ -180,6 +180,8 @@ ...@@ -180,6 +180,8 @@
* *
* 4.06 Dec 17, 1997 -- fixed endless "tray open" messages -ml * 4.06 Dec 17, 1997 -- fixed endless "tray open" messages -ml
* 4.07 Dec 17, 1997 -- fallback to set pc->stat on "tray open" * 4.07 Dec 17, 1997 -- fallback to set pc->stat on "tray open"
* 4.08 Dec 18, 1997 -- spew less noise when tray is empty
* -- fix speed display for ACER 24X, 18X
* *
*************************************************************************/ *************************************************************************/
...@@ -243,6 +245,15 @@ void cdrom_analyze_sense_data (ide_drive_t *drive, ...@@ -243,6 +245,15 @@ void cdrom_analyze_sense_data (ide_drive_t *drive,
failed_command->c[0] == SCMD_READ_SUBCHANNEL) failed_command->c[0] == SCMD_READ_SUBCHANNEL)
return; return;
} }
if (reqbuf->error_code == 0x70 && reqbuf->sense_key == 0x02
&& reqbuf->asc == 0x3a && reqbuf->ascq == 0x00)
{
/*
* No disc in drive ("Medium not present"),
* so keep the noise level down to a dull roar.
*/
return;
}
#if VERBOSE_IDE_CD_ERRORS #if VERBOSE_IDE_CD_ERRORS
{ {
...@@ -466,7 +477,7 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, ...@@ -466,7 +477,7 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat,
/* Check for tray open. */ /* Check for tray open. */
if (sense_key == NOT_READY) { if (sense_key == NOT_READY) {
cdrom_saw_media_change (drive); cdrom_saw_media_change (drive);
#if 0 /* let the upper layers do the complaining */
/* Print an error message to the syslog. /* Print an error message to the syslog.
Exception: don't print anything if this Exception: don't print anything if this
is a read subchannel command. This is is a read subchannel command. This is
...@@ -474,12 +485,13 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, ...@@ -474,12 +485,13 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat,
with this command, and we don't want with this command, and we don't want
to uselessly fill up the syslog. */ to uselessly fill up the syslog. */
if (pc->c[0] != SCMD_READ_SUBCHANNEL) if (pc->c[0] != SCMD_READ_SUBCHANNEL)
printk ("%s: tray open or drive not ready\n", printk ("%s: tray open or drive not ready\n", drive->name);
drive->name); #endif
} else if (sense_key == UNIT_ATTENTION) { } else if (sense_key == UNIT_ATTENTION) {
/* Check for media change. */ /* Check for media change. */
cdrom_saw_media_change (drive); cdrom_saw_media_change (drive);
printk ("%s: media changed\n", drive->name); printk ("%s: media changed\n", drive->name);
return 0;
} else { } else {
/* Otherwise, print an error. */ /* Otherwise, print an error. */
ide_dump_status (drive, "packet command error", ide_dump_status (drive, "packet command error",
...@@ -2734,12 +2746,13 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) ...@@ -2734,12 +2746,13 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
} }
} }
if (drive->id && drive->id->model[0]) { /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */
CDROM_STATE_FLAGS (drive)->current_speed = (ntohs(buf.cap.curspeed) + (176/2)) / 176; if (drive->id && !drive->id->model[0] && !strncmp(drive->id->fw_rev, "241N", 4)) {
CDROM_CONFIG_FLAGS (drive)->max_speed = (ntohs(buf.cap.maxspeed) + (176/2)) / 176;
} else { /* no-name ACERs (AOpen) have it backwards */
CDROM_STATE_FLAGS (drive)->current_speed = (((unsigned int)buf.cap.curspeed) + (176/2)) / 176; CDROM_STATE_FLAGS (drive)->current_speed = (((unsigned int)buf.cap.curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS (drive)->max_speed = (((unsigned int)buf.cap.maxspeed) + (176/2)) / 176; CDROM_CONFIG_FLAGS (drive)->max_speed = (((unsigned int)buf.cap.maxspeed) + (176/2)) / 176;
} else {
CDROM_STATE_FLAGS (drive)->current_speed = (ntohs(buf.cap.curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS (drive)->max_speed = (ntohs(buf.cap.maxspeed) + (176/2)) / 176;
} }
printk ("%s: ATAPI %dX CDROM", printk ("%s: ATAPI %dX CDROM",
......
This diff is collapsed.
This diff is collapsed.
...@@ -166,10 +166,7 @@ ...@@ -166,10 +166,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/bitops.h> #include <asm/bitops.h>
#include <stdlib.h> #include <linux/ctype.h>
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
......
...@@ -53,6 +53,12 @@ if [ "$CONFIG_IPX" != "n" ]; then ...@@ -53,6 +53,12 @@ if [ "$CONFIG_IPX" != "n" ]; then
tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS
fi fi
tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
tristate 'NTFS filesystem support (read only)' CONFIG_NTFS_FS
if [ "$CONFIG_NTFS_FS" != "n" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
bool ' NTFS read-write support (experimental)' CONFIG_NTFS_RW
fi
tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
tristate 'Amiga FFS filesystem support' CONFIG_AFFS_FS tristate 'Amiga FFS filesystem support' CONFIG_AFFS_FS
tristate 'ROM filesystem support' CONFIG_ROMFS_FS tristate 'ROM filesystem support' CONFIG_ROMFS_FS
......
...@@ -16,7 +16,7 @@ O_OBJS = open.o read_write.o devices.o file_table.o buffer.o \ ...@@ -16,7 +16,7 @@ O_OBJS = open.o read_write.o devices.o file_table.o buffer.o \
inode.o dcache.o attr.o bad_inode.o $(BINFMTS) inode.o dcache.o attr.o bad_inode.o $(BINFMTS)
MOD_LIST_NAME := FS_MODULES MOD_LIST_NAME := FS_MODULES
ALL_SUB_DIRS = coda minix ext2 fat msdos vfat proc isofs nfs umsdos \ ALL_SUB_DIRS = coda minix ext2 fat msdos vfat proc isofs nfs umsdos ntfs \
hpfs sysv smbfs ncpfs ufs affs romfs autofs lockd nfsd nls hpfs sysv smbfs ncpfs ufs affs romfs autofs lockd nfsd nls
ifeq ($(CONFIG_QUOTA),y) ifeq ($(CONFIG_QUOTA),y)
...@@ -170,6 +170,14 @@ else ...@@ -170,6 +170,14 @@ else
endif endif
endif endif
ifeq ($(CONFIG_NTFS_FS),y)
SUB_DIRS += ntfs
else
ifeq ($(CONFIG_NTFS_FS),m)
MOD_SUB_DIRS += ntfs
endif
endif
ifeq ($(CONFIG_UFS_FS),y) ifeq ($(CONFIG_UFS_FS),y)
SUB_DIRS += ufs SUB_DIRS += ufs
else else
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/ufs_fs.h> #include <linux/ufs_fs.h>
#include <linux/romfs_fs.h> #include <linux/romfs_fs.h>
#include <linux/auto_fs.h> #include <linux/auto_fs.h>
#include <linux/ntfs_fs.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
...@@ -105,6 +106,10 @@ __initfunc(static void do_sys_setup(void)) ...@@ -105,6 +106,10 @@ __initfunc(static void do_sys_setup(void))
init_hpfs_fs(); init_hpfs_fs();
#endif #endif
#ifdef CONFIG_NTFS_FS
init_ntfs_fs();
#endif
#ifdef CONFIG_AFFS_FS #ifdef CONFIG_AFFS_FS
init_affs_fs(); init_affs_fs();
#endif #endif
......
...@@ -33,29 +33,38 @@ static int ...@@ -33,29 +33,38 @@ static int
nsm_mon_unmon(struct nlm_host *host, char *what, u32 proc) nsm_mon_unmon(struct nlm_host *host, char *what, u32 proc)
{ {
struct rpc_clnt *clnt; struct rpc_clnt *clnt;
int status;
struct nsm_args args; struct nsm_args args;
struct nsm_res res; struct nsm_res res;
int status;
dprintk("lockd: nsm_%s(%s)\n", what, host->h_name); dprintk("lockd: nsm_%s(%s)\n", what, host->h_name);
if (!(clnt = nsm_create())) status = -EACCES;
return -EACCES; clnt = nsm_create();
if (!clnt)
goto out;
args.addr = host->h_addr.sin_addr.s_addr; args.addr = host->h_addr.sin_addr.s_addr;
args.prog = NLM_PROGRAM; args.prog = NLM_PROGRAM;
args.vers = 1; args.vers = 1;
args.proc = NLMPROC_NSM_NOTIFY; args.proc = NLMPROC_NSM_NOTIFY;
if ((status = rpc_call(clnt, proc, &args, &res, 0)) < 0) status = rpc_call(clnt, proc, &args, &res, 0);
return status; if (status < 0) {
printk(KERN_DEBUG "nsm_mon_unmon: rpc failed, status=%d\n",
status);
goto out;
}
status = -EACCES;
if (res.status != 0) { if (res.status != 0) {
printk(KERN_NOTICE "lockd: cannot %s %s\n", what, host->h_name); printk(KERN_NOTICE "lockd: cannot %s %s\n", what, host->h_name);
return -EACCES; goto out;
} }
nsm_local_state = res.state; nsm_local_state = res.state;
return 0; status = 0;
out:
return status;
} }
/* /*
...@@ -66,7 +75,8 @@ nsm_monitor(struct nlm_host *host) ...@@ -66,7 +75,8 @@ nsm_monitor(struct nlm_host *host)
{ {
int status; int status;
if ((status = nsm_mon_unmon(host, "monitor", SM_MON)) >= 0) status = nsm_mon_unmon(host, "monitor", SM_MON);
if (status >= 0)
host->h_monitored = 1; host->h_monitored = 1;
return status; return status;
} }
...@@ -90,28 +100,32 @@ nsm_unmonitor(struct nlm_host *host) ...@@ -90,28 +100,32 @@ nsm_unmonitor(struct nlm_host *host)
static struct rpc_clnt * static struct rpc_clnt *
nsm_create(void) nsm_create(void)
{ {
struct sockaddr_in sin;
struct rpc_xprt *xprt; struct rpc_xprt *xprt;
struct rpc_clnt *clnt; struct rpc_clnt *clnt = NULL;
struct sockaddr_in sin;
sin.sin_family = AF_INET; sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sin.sin_port = 0; sin.sin_port = 0;
if (!(xprt = xprt_create_proto(IPPROTO_UDP, &sin, NULL))) xprt = xprt_create_proto(IPPROTO_UDP, &sin, NULL);
return NULL; if (!xprt)
goto out;
clnt = rpc_create_client(xprt, "localhost", clnt = rpc_create_client(xprt, "localhost",
&nsm_program, SM_VERSION, &nsm_program, SM_VERSION,
RPC_AUTH_NULL); RPC_AUTH_NULL);
if (!clnt) { if (!clnt)
xprt_destroy(xprt); goto out_destroy;
} else { clnt->cl_softrtry = 1;
clnt->cl_softrtry = 1; clnt->cl_chatty = 1;
clnt->cl_chatty = 1; clnt->cl_oneshot = 1;
clnt->cl_oneshot = 1; out:
}
return clnt; return clnt;
out_destroy:
xprt_destroy(xprt);
goto out;
} }
/* /*
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/nfs.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/uio.h> #include <linux/uio.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -33,11 +32,11 @@ ...@@ -33,11 +32,11 @@
#include <linux/sunrpc/svc.h> #include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svcsock.h> #include <linux/sunrpc/svcsock.h>
#include <linux/lockd/lockd.h> #include <linux/lockd/lockd.h>
#include <linux/nfs.h>
#define NLMDBG_FACILITY NLMDBG_SVC #define NLMDBG_FACILITY NLMDBG_SVC
#define LOCKD_BUFSIZE (1024 + NLMSSVC_XDRSIZE) #define LOCKD_BUFSIZE (1024 + NLMSSVC_XDRSIZE)
#define BLOCKABLE_SIGS (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) #define ALLOWED_SIGS (sigmask(SIGKILL) | sigmask(SIGSTOP))
extern struct svc_program nlmsvc_program; extern struct svc_program nlmsvc_program;
struct nlmsvc_binding * nlmsvc_ops = NULL; struct nlmsvc_binding * nlmsvc_ops = NULL;
...@@ -148,23 +147,22 @@ lockd(struct svc_rqst *rqstp) ...@@ -148,23 +147,22 @@ lockd(struct svc_rqst *rqstp)
} }
dprintk("lockd: request from %08x\n", dprintk("lockd: request from %08x\n",
(unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr)); (unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr));
/* /*
* Look up the NFS client handle. The handle is needed for * Look up the NFS client handle. The handle is needed for
* all but the GRANTED callback RPCs. * all but the GRANTED callback RPCs.
*/ */
rqstp->rq_client = NULL;
if (nlmsvc_ops) { if (nlmsvc_ops) {
nlmsvc_ops->exp_readlock(); nlmsvc_ops->exp_readlock();
rqstp->rq_client = rqstp->rq_client =
nlmsvc_ops->exp_getclient(&rqstp->rq_addr); nlmsvc_ops->exp_getclient(&rqstp->rq_addr);
} else {
rqstp->rq_client = NULL;
} }
/* Process request with all signals blocked. */ /* Process request with signals blocked. */
spin_lock_irq(&current->sigmask_lock); spin_lock_irq(&current->sigmask_lock);
siginitsetinv(&current->blocked, ~BLOCKABLE_SIGS); siginitsetinv(&current->blocked, ALLOWED_SIGS);
recalc_sigpending(current); recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
...@@ -201,22 +199,6 @@ lockd(struct svc_rqst *rqstp) ...@@ -201,22 +199,6 @@ lockd(struct svc_rqst *rqstp)
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
} }
/*
* Make a socket for lockd
* FIXME: Move this to net/sunrpc/svc.c so that we can share this with nfsd.
*/
static int
lockd_makesock(struct svc_serv *serv, int protocol, unsigned short port)
{
struct sockaddr_in sin;
dprintk("lockd: creating socket proto = %d\n", protocol);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons(port);
return svc_create_socket(serv, protocol, &sin);
}
/* /*
* Bring up the lockd process if it's not already up. * Bring up the lockd process if it's not already up.
*/ */
...@@ -252,8 +234,8 @@ lockd_up(void) ...@@ -252,8 +234,8 @@ lockd_up(void)
goto out; goto out;
} }
if ((error = lockd_makesock(serv, IPPROTO_UDP, 0)) < 0 if ((error = svc_makesock(serv, IPPROTO_UDP, 0)) < 0
|| (error = lockd_makesock(serv, IPPROTO_TCP, 0)) < 0) { || (error = svc_makesock(serv, IPPROTO_TCP, 0)) < 0) {
printk("lockd_up: makesock failed, error=%d\n", error); printk("lockd_up: makesock failed, error=%d\n", error);
goto destroy_and_out; goto destroy_and_out;
} }
...@@ -302,13 +284,17 @@ lockd_down(void) ...@@ -302,13 +284,17 @@ lockd_down(void)
* Wait for the lockd process to exit, but since we're holding * Wait for the lockd process to exit, but since we're holding
* the lockd semaphore, we can't wait around forever ... * the lockd semaphore, we can't wait around forever ...
*/ */
current->timeout = jiffies + 5 * HZ; current->sigpending = 0;
current->timeout = jiffies + HZ;
interruptible_sleep_on(&lockd_exit); interruptible_sleep_on(&lockd_exit);
current->timeout = 0; current->timeout = 0;
if (nlmsvc_pid) { if (nlmsvc_pid) {
printk("lockd_down: lockd failed to exit, clearing pid\n"); printk("lockd_down: lockd failed to exit, clearing pid\n");
nlmsvc_pid = 0; nlmsvc_pid = 0;
} }
spin_lock_irq(&current->sigmask_lock);
recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock);
out: out:
up(&nlmsvc_sema); up(&nlmsvc_sema);
} }
......
...@@ -21,17 +21,31 @@ ...@@ -21,17 +21,31 @@
static int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 }; static int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 };
static unsigned long count_free(struct buffer_head *map[], unsigned numblocks) static unsigned long count_free(struct buffer_head *map[], unsigned numblocks, __u32 numbits)
{ {
unsigned i, j, sum = 0; unsigned i, j, sum = 0;
struct buffer_head *bh; struct buffer_head *bh;
for (i=0; i<numblocks; i++) { for (i=0; i<numblocks-1; i++) {
if (!(bh=map[i])) if (!(bh=map[i]))
return(0); return(0);
for (j=0; j<BLOCK_SIZE; j++) for (j=0; j<BLOCK_SIZE; j++)
sum += nibblemap[bh->b_data[j] & 0xf] sum += nibblemap[bh->b_data[j] & 0xf]
+ nibblemap[(bh->b_data[j]>>4)&0xf]; + nibblemap[(bh->b_data[j]>>4) & 0xf];
}
if (numblocks==0 || !(bh=map[numblocks-1]))
return(0);
i = (numbits-(numblocks-1)*BLOCK_SIZE*8)/8;
for (j=0; j<i; j++) {
sum += nibblemap[bh->b_data[j] & 0xf]
+ nibblemap[(bh->b_data[j]>>4) & 0xf];
}
i = numbits%8;
if (i!=0) {
i = bh->b_data[j] | ~((1<<i) - 1);
sum += nibblemap[i & 0xf] + nibblemap[(i>>4) & 0xf];
} }
return(sum); return(sum);
} }
...@@ -108,8 +122,9 @@ int minix_new_block(struct super_block * sb) ...@@ -108,8 +122,9 @@ int minix_new_block(struct super_block * sb)
unsigned long minix_count_free_blocks(struct super_block *sb) unsigned long minix_count_free_blocks(struct super_block *sb)
{ {
return (count_free(sb->u.minix_sb.s_zmap,sb->u.minix_sb.s_zmap_blocks) return (count_free(sb->u.minix_sb.s_zmap, sb->u.minix_sb.s_zmap_blocks,
<< sb->u.minix_sb.s_log_zone_size); sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone + 1)
<< sb->u.minix_sb.s_log_zone_size);
} }
static struct buffer_head *V1_minix_clear_inode(struct inode *inode) static struct buffer_head *V1_minix_clear_inode(struct inode *inode)
...@@ -266,5 +281,6 @@ struct inode * minix_new_inode(const struct inode * dir) ...@@ -266,5 +281,6 @@ struct inode * minix_new_inode(const struct inode * dir)
unsigned long minix_count_free_inodes(struct super_block *sb) unsigned long minix_count_free_inodes(struct super_block *sb)
{ {
return count_free(sb->u.minix_sb.s_imap,sb->u.minix_sb.s_imap_blocks); return count_free(sb->u.minix_sb.s_imap, sb->u.minix_sb.s_imap_blocks,
sb->u.minix_sb.s_ninodes + 1);
} }
...@@ -36,28 +36,13 @@ ...@@ -36,28 +36,13 @@
#define NFSDDBG_FACILITY NFSDDBG_SVC #define NFSDDBG_FACILITY NFSDDBG_SVC
#define NFSD_BUFSIZE (1024 + NFSSVC_MAXBLKSIZE) #define NFSD_BUFSIZE (1024 + NFSSVC_MAXBLKSIZE)
#define BLOCKABLE_SIGS (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) #define ALLOWED_SIGS (sigmask(SIGKILL) | sigmask(SIGSTOP))
#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM)) #define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGTERM))
extern struct svc_program nfsd_program; extern struct svc_program nfsd_program;
static void nfsd(struct svc_rqst *rqstp); static void nfsd(struct svc_rqst *rqstp);
struct timeval nfssvc_boot = { 0, 0 }; struct timeval nfssvc_boot = { 0, 0 };
/*
* Make a socket for nfsd
*/
static int
nfsd_makesock(struct svc_serv *serv, int protocol, unsigned short port)
{
struct sockaddr_in sin;
dprintk("nfsd: creating socket proto = %d\n", protocol);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons(port);
return svc_create_socket(serv, protocol, &sin);
}
int int
nfsd_svc(unsigned short port, int nrservs) nfsd_svc(unsigned short port, int nrservs)
{ {
...@@ -65,17 +50,19 @@ nfsd_svc(unsigned short port, int nrservs) ...@@ -65,17 +50,19 @@ nfsd_svc(unsigned short port, int nrservs)
int error; int error;
dprintk("nfsd: creating service\n"); dprintk("nfsd: creating service\n");
error = -EINVAL;
if (nrservs < 0) if (nrservs < 0)
return -EINVAL; goto out;
if (nrservs > NFSD_MAXSERVS) if (nrservs > NFSD_MAXSERVS)
nrservs = NFSD_MAXSERVS; nrservs = NFSD_MAXSERVS;
error = -ENOMEM;
serv = svc_create(&nfsd_program, NFSD_BUFSIZE, NFSSVC_XDRSIZE); serv = svc_create(&nfsd_program, NFSD_BUFSIZE, NFSSVC_XDRSIZE);
if (serv == NULL) if (serv == NULL)
return -ENOMEM; goto out;
if ((error = nfsd_makesock(serv, IPPROTO_UDP, port)) < 0 if ((error = svc_makesock(serv, IPPROTO_UDP, port)) < 0
|| (error = nfsd_makesock(serv, IPPROTO_TCP, port)) < 0) || (error = svc_makesock(serv, IPPROTO_TCP, port)) < 0)
goto failure; goto failure;
while (nrservs--) { while (nrservs--) {
...@@ -86,6 +73,7 @@ nfsd_svc(unsigned short port, int nrservs) ...@@ -86,6 +73,7 @@ nfsd_svc(unsigned short port, int nrservs)
failure: failure:
svc_destroy(serv); /* Release server */ svc_destroy(serv); /* Release server */
out:
return error; return error;
} }
...@@ -98,16 +86,15 @@ nfsd(struct svc_rqst *rqstp) ...@@ -98,16 +86,15 @@ nfsd(struct svc_rqst *rqstp)
struct svc_serv *serv = rqstp->rq_server; struct svc_serv *serv = rqstp->rq_server;
int oldumask, err; int oldumask, err;
lock_kernel();
/* Lock module and set up kernel thread */ /* Lock module and set up kernel thread */
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
lock_kernel();
exit_mm(current); exit_mm(current);
current->session = 1; current->session = 1;
current->pgrp = 1; current->pgrp = 1;
sprintf(current->comm, "nfsd"); sprintf(current->comm, "nfsd");
oldumask = current->fs->umask; /* Set umask to 0. */ oldumask = current->fs->umask; /* Set umask to 0. */
siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
current->fs->umask = 0; current->fs->umask = 0;
nfssvc_boot = xtime; /* record boot time */ nfssvc_boot = xtime; /* record boot time */
lockd_up(); /* start lockd */ lockd_up(); /* start lockd */
...@@ -116,6 +103,12 @@ nfsd(struct svc_rqst *rqstp) ...@@ -116,6 +103,12 @@ nfsd(struct svc_rqst *rqstp)
* The main request loop * The main request loop
*/ */
for (;;) { for (;;) {
/* Block all but the shutdown signals */
spin_lock_irq(&current->sigmask_lock);
siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock);
/* /*
* Find a socket with data available and call its * Find a socket with data available and call its
* recvfrom routine. * recvfrom routine.
...@@ -140,18 +133,13 @@ nfsd(struct svc_rqst *rqstp) ...@@ -140,18 +133,13 @@ nfsd(struct svc_rqst *rqstp)
svc_drop(rqstp); svc_drop(rqstp);
serv->sv_stats->rpcbadclnt++; serv->sv_stats->rpcbadclnt++;
} else { } else {
/* Process request with all signals blocked. */ /* Process request with signals blocked. */
spin_lock_irq(&current->sigmask_lock); spin_lock_irq(&current->sigmask_lock);
siginitsetinv(&current->blocked, ~BLOCKABLE_SIGS); siginitsetinv(&current->blocked, ALLOWED_SIGS);
recalc_sigpending(current); recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
svc_process(serv, rqstp); svc_process(serv, rqstp);
spin_lock_irq(&current->sigmask_lock);
siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock);
} }
/* Unlock export hash tables */ /* Unlock export hash tables */
......
...@@ -568,7 +568,8 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -568,7 +568,8 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
dchild = lookup_dentry(fname, dget(dentry), 0); dchild = lookup_dentry(fname, dget(dentry), 0);
err = PTR_ERR(dchild); err = PTR_ERR(dchild);
if(IS_ERR(dchild)) if(IS_ERR(dchild))
return nfserrno(-err); goto out_nfserr;
fh_compose(resfhp, fhp->fh_export, dchild);
} else } else
dchild = resfhp->fh_dentry; dchild = resfhp->fh_dentry;
/* /*
...@@ -597,19 +598,14 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -597,19 +598,14 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
fh_unlock(fhp); fh_unlock(fhp);
if (err < 0) if (err < 0)
return nfserrno(-err); goto out_nfserr;
if (EX_ISSYNC(fhp->fh_export)) if (EX_ISSYNC(fhp->fh_export))
write_inode_now(dirp); write_inode_now(dirp);
/* /*
* Assemble the file handle for the newly created file, * Update the filehandle to get the new inode info.
* or update the filehandle to get the new inode info.
*/ */
if (!resfhp->fh_dverified) { fh_update(resfhp);
fh_compose(resfhp, fhp->fh_export, dchild);
} else {
fh_update(resfhp);
}
/* Set file attributes. Mode has already been set and /* Set file attributes. Mode has already been set and
* setting uid/gid works only for root. Irix appears to * setting uid/gid works only for root. Irix appears to
...@@ -621,6 +617,10 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -621,6 +617,10 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
err = nfsd_setattr(rqstp, resfhp, iap); err = nfsd_setattr(rqstp, resfhp, iap);
out: out:
return err; return err;
out_nfserr:
err = nfserrno(-err);
goto out;
} }
/* /*
...@@ -694,19 +694,21 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) ...@@ -694,19 +694,21 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
goto out; goto out;
UPDATE_ATIME(inode); UPDATE_ATIME(inode);
/* N.B. Why does this call need a get_fs()?? */
oldfs = get_fs(); set_fs(KERNEL_DS); oldfs = get_fs(); set_fs(KERNEL_DS);
err = inode->i_op->readlink(inode, buf, *lenp); err = inode->i_op->readlink(inode, buf, *lenp);
set_fs(oldfs); set_fs(oldfs);
if (err < 0) if (err < 0)
err = nfserrno(-err); goto out_nfserr;
else { *lenp = err;
*lenp = err; err = 0;
err = 0;
}
out: out:
return err; return err;
out_nfserr:
err = nfserrno(-err);
goto out;
} }
/* /*
...@@ -755,12 +757,14 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -755,12 +757,14 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
} }
} }
fh_compose(resfhp, fhp->fh_export, dnew); fh_compose(resfhp, fhp->fh_export, dnew);
out_nfserr:
if (err) if (err)
err = nfserrno(-err); goto out_nfserr;
out: out:
return err; return err;
out_nfserr:
err = nfserrno(-err);
goto out;
} }
/* /*
...@@ -821,11 +825,14 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp, ...@@ -821,11 +825,14 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
} }
dput_and_out: dput_and_out:
dput(dnew); dput(dnew);
out_nfserr:
if (err) if (err)
err = nfserrno(-err); goto out_nfserr;
out: out:
return err; return err;
out_nfserr:
err = nfserrno(-err);
goto out;
} }
/* /*
...@@ -917,11 +924,14 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, ...@@ -917,11 +924,14 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
out_dput_old: out_dput_old:
dput(odentry); dput(odentry);
out_nfserr:
if (err) if (err)
err = nfserrno(-err); goto out_nfserr;
out: out:
return err; return err;
out_nfserr:
err = nfserrno(-err);
goto out;
} }
/* /*
...@@ -965,14 +975,16 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, ...@@ -965,14 +975,16 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
fh_unlock(fhp); fh_unlock(fhp);
dput(rdentry); dput(rdentry);
if (!err && EX_ISSYNC(fhp->fh_export))
write_inode_now(dirp);
out_nfserr:
if (err) if (err)
err = nfserrno(-err); goto out_nfserr;
if (EX_ISSYNC(fhp->fh_export))
write_inode_now(dirp);
out: out:
return err; return err;
out_nfserr:
err = nfserrno(-err);
goto out;
} }
/* /*
...@@ -982,22 +994,23 @@ int ...@@ -982,22 +994,23 @@ int
nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
encode_dent_fn func, u32 *buffer, int *countp) encode_dent_fn func, u32 *buffer, int *countp)
{ {
struct readdir_cd cd;
struct inode *inode; struct inode *inode;
struct file file;
u32 *p; u32 *p;
int oldlen, eof, err; int oldlen, eof, err;
struct file file;
struct readdir_cd cd;
err = 0;
if (offset > ~(u32) 0) if (offset > ~(u32) 0)
return 0; goto out;
if ((err = nfsd_open(rqstp, fhp, S_IFDIR, OPEN_READ, &file)) != 0) err = nfsd_open(rqstp, fhp, S_IFDIR, OPEN_READ, &file);
return err; if (err)
goto out;
if (!file.f_op->readdir) { err = nfserr_notdir;
nfsd_close(&file); if (!file.f_op->readdir)
return nfserr_notdir; goto out_close;
}
file.f_pos = offset; file.f_pos = offset;
/* Set up the readdir context */ /* Set up the readdir context */
...@@ -1012,7 +1025,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -1012,7 +1025,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
* may choose to do less. * may choose to do less.
*/ */
inode = file.f_dentry->d_inode; inode = file.f_dentry->d_inode;
do { while (1) {
oldlen = cd.buflen; oldlen = cd.buflen;
/* /*
...@@ -1020,16 +1033,16 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -1020,16 +1033,16 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
file.f_inode->i_dev, file.f_inode->i_ino, file.f_inode->i_dev, file.f_inode->i_ino,
(int) file.f_pos, (int) oldlen, (int) cd.buflen); (int) file.f_pos, (int) oldlen, (int) cd.buflen);
*/ */
err = file.f_op->readdir(&file, down(&inode->i_sem);
&cd, (filldir_t) func); err = file.f_op->readdir(&file, &cd, (filldir_t) func);
up(&inode->i_sem);
if (err < 0) { if (err < 0)
nfsd_close(&file); goto out_nfserr;
return nfserrno(-err);
}
if (oldlen == cd.buflen) if (oldlen == cd.buflen)
break; break;
} while (oldlen != cd.buflen && !cd.eob); if (cd.eob)
break;
}
/* If we didn't fill the buffer completely, we're at EOF */ /* If we didn't fill the buffer completely, we're at EOF */
eof = !cd.eob; eof = !cd.eob;
...@@ -1040,9 +1053,6 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -1040,9 +1053,6 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
if (cd.offset && !eof) if (cd.offset && !eof)
*cd.offset = htonl(file.f_pos); *cd.offset = htonl(file.f_pos);
/* Close the file */
nfsd_close(&file);
p = cd.buffer; p = cd.buffer;
*p++ = 0; /* no more entries */ *p++ = 0; /* no more entries */
*p++ = htonl(eof); /* end of directory */ *p++ = htonl(eof); /* end of directory */
...@@ -1051,7 +1061,15 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -1051,7 +1061,15 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
dprintk("nfsd: readdir result %d bytes, eof %d offset %ld\n", dprintk("nfsd: readdir result %d bytes, eof %d offset %ld\n",
*countp, eof, *countp, eof,
cd.offset? ntohl(*cd.offset) : -1); cd.offset? ntohl(*cd.offset) : -1);
return 0; err = 0;
out_close:
nfsd_close(&file);
out:
return err;
out_nfserr:
err = nfserrno(-err);
goto out_close;
} }
/* /*
......
...@@ -6,7 +6,8 @@ mainmenu_option next_comment ...@@ -6,7 +6,8 @@ mainmenu_option next_comment
comment 'Native Language Support' comment 'Native Language Support'
# msdos and Joliet want NLS # msdos and Joliet want NLS
if [ "$CONFIG_JOLIET" = "y" -o "$CONFIG_FAT_FS" != "n" ]; then if [ "$CONFIG_JOLIET" = "y" -o "$CONFIG_FAT_FS" != "n" \
-o "$CONFIG_NTFS_FS" != "n" ]; then
define_bool CONFIG_NLS y define_bool CONFIG_NLS y
else else
define_bool CONFIG_NLS n define_bool CONFIG_NLS n
......
# Rules for making the NTFS driver
O_TARGET := ntfs.o
O_OBJS := fs.o sysctl.o support.o util.o inode.o dir.o super.o attr.o
M_OBJS := $(O_TARGET)
EXTRA_CFLAGS = -DNTFS_IN_LINUX_KERNEL -DNTFS_VERSION=\"971219\"
include $(TOPDIR)/Rules.make
This diff is collapsed.
/*
* attr.h
* Header file for attr.c
*
* Copyright (C) 1997 Régis Duchesne
*/
int ntfs_extend_attr(ntfs_inode *ino, ntfs_attribute *attr, int *len,
int flags);
int ntfs_resize_attr(ntfs_inode *ino, ntfs_attribute *attr, int newsize);
int ntfs_insert_attribute(ntfs_inode *ino, unsigned char* attrdata);
int ntfs_read_compressed(ntfs_inode *ino, ntfs_attribute *attr, int offset,
ntfs_io *dest);
int ntfs_write_compressed(ntfs_inode *ino, ntfs_attribute *attr, int offset,
ntfs_io *dest);
int ntfs_create_attr(ntfs_inode *ino, int anum, char *aname, void *data,
int dsize, ntfs_attribute **rattr);
This diff is collapsed.
/*
* dir.h
* Header file for dir.c
*
* Copyright (C) 1997 Rgis Duchesne
*/
#define ITERATE_SPLIT_DONE 1
enum ntfs_iterate_e {
BY_POSITION,
BY_NAME,
DIR_INSERT
};
/* not all fields are used for all operations */
typedef struct ntfs_iterate_s{
enum ntfs_iterate_e type;
ntfs_inode *dir;
union{
long long pos;
int flags;
}u;
char *result; /* pointer to entry if found */
ntfs_u16* name;
int namelen;
int block; /* current index record */
int newblock; /* index record created in a split */
char *new_entry;
int new_entry_size;
/*ntfs_inode* new;*/
} ntfs_iterate_s;
int ntfs_getdir_unsorted(ntfs_inode *ino, ntfs_u32 *p_high, ntfs_u32* p_low,
int(*cb)(ntfs_u8*,void*), void *param);
int ntfs_getdir_byname(ntfs_iterate_s *walk);
int ntfs_dir_add(ntfs_inode *dir, ntfs_inode *new, ntfs_attribute *name);
int ntfs_check_index_record(ntfs_inode *ino, char *record);
int ntfs_getdir_byposition(ntfs_iterate_s *walk);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment