Commit a14d6284 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.2.7pre1

parent 742db559
......@@ -7443,6 +7443,26 @@ CONFIG_NCPFS_OS2_NS
case insensitive, and case in names is preserved. Say Y. You can
disable it at mount time with the -N os2 parameter of ncpmount.
Lowercase DOS filenames on LONG namespace volume
CONFIG_NCPFS_SMALLDOS
Saying Y here will convert every filename with creator/owner DOS
namespace on NetWare servers to lowercase characters as silently
kernel does when you mount NetWare file server volumes with DOS
namespace without OS2/LONG namespace support. Saying N here will
give you these filenames with uppercase characters.
This is only cosmetic option because of OS2/LONG namespace is
case insensitive. The only major reason for this option is
backward compatibility when you want to do step from DOS to
OS2/LONG namespace support. Long filenames (created by Win95)
will not be affected.
This option does not solve a problem that filenames appear
differently in Linux box and in MS environment because of MS
does an additional conversions on client side. You can achieve
simillar effects enabling ncpfs option "Allow using of Native
Language Support" below.
Allow mounting of volume subdirectories
CONFIG_NCPFS_MOUNT_SUBDIR
Allows you to mount not only whole servers or whole volumes, but
......@@ -7461,6 +7481,25 @@ CONFIG_NCPFS_NDS_DOMAINS
servers. Do not say Y if security is primary for you because root
can read your session key (from /proc/kcore).
Allow using of Native Language Support
CONFIG_NCPFS_NLS
Allows you to use codepages and I/O charsets for file name translation
between file system on server and input/output. This may be useful,
if you want to access to the server with other operating systems,
e.g. Windows 95. See also NLS for more Information.
To select codepages and I/O charsets use ncpfs-2.2.0.13 or newer.
Symbolic links and mode permission bits
CONFIG_NCPFS_EXTRAS
This enables the use of symbolic links and an execute permission
bit on NCPFS. The file server need not have long name space or NFS
name space loaded for these to work, they are stored using rarely
found combinations of Hidden, System and Shared flags.
To use the new attributes, you are recommended to use the flags
'-f 600 -d 755' on the ncpmount commandline.
nls codepage 437
CONFIG_NLS_CODEPAGE_437
The Microsoft fat filesystem family can deal with filenames in
......
[This file is cloned from VesaFB. Thanks go to Gerd Knorr]
what is matroxfb?
What is matroxfb?
=================
This is a driver for a graphic framebuffer for Matrox devices on
......@@ -221,6 +221,8 @@ pixclock:X - dotclocks, in ps (picoseconds). Default is derived from `vesa'
sync:X - sync. pulse - bit 0 inverts HSYNC polarity, bit 1 VSYNC polarity.
If bit 3 (value 0x08) is set, composite sync instead of HSYNC is
generated. If bit 5 (value 0x20) is set, sync on green is turned on.
Do not forget that if you want sync on green, you also probably
want composite sync.
Default depends on `vesa'.
depth:X - Bits per pixel: 0=text, 4,8,15,16,24 or 32. Default depends on
`vesa'.
......@@ -284,8 +286,6 @@ And following features:
+ current fbset is not able to set 15bpp videomode: you must specify
depth==16 and green.length==5. fbset does not allow you to set
green.length.
+ hardware cursor is available only in accelerated videomodes. Maybe that
this is misfeature and not feature.
+ text mode uses 6 bit VGA palette instead of 8 bit (one of 262144 colors
instead of one of 16M colors). It is due to hardware limitation of
MilleniumI/II and SVGALib compatibility.
......
VERSION = 2
PATCHLEVEL = 2
SUBLEVEL = 6
SUBLEVEL = 7
EXTRAVERSION =
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
......
......@@ -18,6 +18,9 @@
* fixed tick loss calculation in timer_interrupt
* (round system clock to nearest tick instead of truncating)
* fixed algorithm in time_init for getting time from CMOS clock
* 1999-04-16 Thorsten Kranzkowski (dl8bcu@gmx.net)
* fixed algorithm in do_gettimeofday() for calculating the precise time
* from processor cycle counter (now taking lost_ticks into account)
*/
#include <linux/config.h>
#include <linux/errno.h>
......@@ -314,8 +317,10 @@ time_init(void)
void
do_gettimeofday(struct timeval *tv)
{
unsigned long flags, now, delta_cycles, delta_usec;
unsigned long flags, delta_cycles, delta_usec;
unsigned long sec, usec;
__u32 now;
extern volatile unsigned long lost_ticks; /*kernel/sched.c*/
now = rpcc();
save_and_cli(flags);
......@@ -337,9 +342,15 @@ do_gettimeofday(struct timeval *tv)
* with no clear gain.
*/
delta_usec = delta_cycles * state.scaled_ticks_per_cycle * 15625;
delta_usec = (delta_cycles * state.scaled_ticks_per_cycle
+ state.partial_tick
+ (lost_ticks << FIX_SHIFT) ) * 15625;
delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
/* the 'lost_tics' term above implements this:
* delta_usec += lost_ticks * (1000000 / HZ);
*/
usec += delta_usec;
if (usec >= 1000000) {
sec += 1;
......
......@@ -445,6 +445,7 @@ struct pci_dev_info dev_info[] = {
DEVICE( 3DFX, 3DFX_VOODOO2, "Voodoo2"),
DEVICE( 3DFX, 3DFX_BANSHEE, "Banshee"),
DEVICE( SIGMADES, SIGMADES_6425, "REALmagic64/GX"),
DEVICE( AVM, AVM_A1, "A1 (Fritz)"),
DEVICE( STALLION, STALLION_ECHPCI832,"EasyConnection 8/32"),
DEVICE( STALLION, STALLION_ECHPCI864,"EasyConnection 8/64"),
DEVICE( STALLION, STALLION_EIOPCI,"EasyIO"),
......@@ -784,6 +785,7 @@ static const char *pci_strvendor(unsigned int vendor)
case PCI_VENDOR_ID_O2: return "O2 Micro";
case PCI_VENDOR_ID_3DFX: return "3Dfx";
case PCI_VENDOR_ID_SIGMADES: return "Sigma Designs";
case PCI_VENDOR_ID_AVM: return "AVM";
case PCI_VENDOR_ID_CCUBE: return "C-Cube";
case PCI_VENDOR_ID_DIPIX: return "Dipix";
case PCI_VENDOR_ID_STALLION: return "Stallion Technologies";
......
......@@ -4,7 +4,7 @@
*
* (c) 1998,1999 Petr Vandrovec <vandrove@vc.cvut.cz>
*
* Version: 1.9 1999/01/04
* Version: 1.15 1999/04/19
*
* MTRR stuff: 1998 Tom Rini <tmrini@ntplx.net>
*
......@@ -24,6 +24,9 @@
* "Daniel Haun" <haund@usa.net>
* Testing, hardware cursor fixes
*
* "Scott Wood" <sawst46+@pitt.edu>
* Fixes
*
* "Gerd Knorr" <kraxel@goldbach.isdn.cs.tu-berlin.de>
* Betatesting
*
......@@ -452,7 +455,7 @@ struct matrox_accel_data {
#define CPMINFO const struct matrox_fb_info* minfo,
#define PMINFO minfo,
static inline struct matrox_fb_info* mxinfo(struct display* p) {
static inline struct matrox_fb_info* mxinfo(const struct display* p) {
return (struct matrox_fb_info*)p->fb_info;
}
......@@ -474,7 +477,7 @@ struct display global_disp;
#define PMINFO
#if 0
static inline struct matrox_fb_info* mxinfo(struct display* p) {
static inline struct matrox_fb_info* mxinfo(const struct display* p) {
return &global_mxinfo;
}
#endif
......@@ -2191,7 +2194,7 @@ static void matrox_text_putcs(struct vc_data* conp, struct display* p, const uns
step = ACCESS_FBINFO(devflags.textstep);
offs = yy * p->next_line + xx * step;
attr = attr_fgcol(p,scr_readw(s)) | (attr_bgcol(p,scr_readw(s)) << 4);
attr = attr_fgcol(p, scr_readw(s)) | (attr_bgcol(p, scr_readw(s)) << 4);
while (count-- > 0) {
unsigned int chr = ((scr_readw(s++)) & p->charmask) << 8;
if (chr & 0x10000) chr ^= 0x10008;
......@@ -2395,6 +2398,10 @@ static void initMatrox(WPMINFO struct display* p) {
DBG("initMatrox")
if (ACCESS_FBINFO(currcon_display) != p)
return;
if (p->dispsw && p->conp)
fb_con.con_cursor(p->conp, CM_ERASE);
p->dispsw_data = NULL;
if ((p->var.accel_flags & FB_ACCELF_TEXT) != FB_ACCELF_TEXT) {
if (p->type == FB_TYPE_TEXT) {
......@@ -4274,6 +4281,17 @@ static void Ti3026_restore(WPMINFO struct matrox_hw_state* hw, struct matrox_hw_
for (i = 0; i < 21; i++) {
outTi3026(PMINFO DACseq[i], hw->DACreg[i]);
}
if (oldhw) {
outTi3026(PMINFO TVP3026_XPLLADDR, 0x00);
oldhw->DACclk[0] = inTi3026(PMINFO TVP3026_XPIXPLLDATA);
oldhw->DACclk[3] = inTi3026(PMINFO TVP3026_XLOOPPLLDATA);
outTi3026(PMINFO TVP3026_XPLLADDR, 0x15);
oldhw->DACclk[1] = inTi3026(PMINFO TVP3026_XPIXPLLDATA);
oldhw->DACclk[4] = inTi3026(PMINFO TVP3026_XLOOPPLLDATA);
outTi3026(PMINFO TVP3026_XPLLADDR, 0x2A);
oldhw->DACclk[2] = inTi3026(PMINFO TVP3026_XPIXPLLDATA);
oldhw->DACclk[5] = inTi3026(PMINFO TVP3026_XLOOPPLLDATA);
}
if (!oldhw || memcmp(hw->DACclk, oldhw->DACclk, 6)) {
/* agrhh... setting up PLL is very slow on Millenium... */
/* Mystique PLL is locked in few ms, but Millenium PLL lock takes about 0.15 s... */
......@@ -5296,7 +5314,7 @@ static struct board {
"MGA-G200 (AGP)"},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_AGP, 0xFF,
0, 0,
DEVF_VIDEO64BIT | DEVF_SWAPS,
DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB,
230000,
&vbG200,
"unknown G200 (AGP)"},
......@@ -5743,20 +5761,26 @@ leave:;
}
#ifndef MODULE
static int __init initialized = 0;
__initfunc(void matroxfb_init(void))
{
DBG("matroxfb_init")
#if defined(CONFIG_FB_OF)
/* Nothing to do, must be called from offb */
#else
matrox_init();
#endif
if (!initialized) {
initialized = 1;
matrox_init();
}
}
#if defined(CONFIG_FB_OF)
__initfunc(int matrox_of_init(struct device_node *dp)) {
DBG("matrox_of_init");
matrox_init();
if (!initialized) {
initialized = 1;
matrox_init();
}
if (!fb_list) return -ENXIO;
return 0;
}
......
......@@ -486,33 +486,6 @@ static void remove_from_queues(struct buffer_head * bh)
remove_from_lru_list(bh);
}
static inline void put_last_lru(struct buffer_head * bh)
{
if (bh) {
struct buffer_head **bhp = &lru_list[bh->b_list];
if (bh == *bhp) {
*bhp = bh->b_next_free;
return;
}
if(bh->b_dev == B_FREE)
panic("Wrong block for lru list");
/* Add to back of free list. */
remove_from_lru_list(bh);
if(!*bhp) {
*bhp = bh;
(*bhp)->b_prev_free = bh;
}
bh->b_next_free = *bhp;
bh->b_prev_free = (*bhp)->b_prev_free;
(*bhp)->b_prev_free->b_next_free = bh;
(*bhp)->b_prev_free = bh;
}
}
static inline void put_last_free(struct buffer_head * bh)
{
if (bh) {
......@@ -726,8 +699,6 @@ struct buffer_head * getblk(kdev_t dev, int block, int size)
bh = get_hash_table(dev, block, size);
if (bh) {
if (!buffer_dirty(bh)) {
if (buffer_uptodate(bh))
put_last_lru(bh);
bh->b_flushtime = 0;
}
return bh;
......@@ -854,6 +825,7 @@ void __bforget(struct buffer_head * buf)
return;
}
buf->b_count = 0;
buf->b_state = 0;
remove_from_queues(buf);
put_last_free(buf);
}
......@@ -1525,13 +1497,27 @@ void show_buffers(void)
* Use gfp() for the hash table to decrease TLB misses, use
* SLAB cache for buffer heads.
*/
void __init buffer_init(void)
void __init buffer_init(unsigned long memory_size)
{
int order = 5; /* Currently maximum order.. */
int order;
unsigned int nr_hash;
nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct buffer_head *);
hash_table = (struct buffer_head **) __get_free_pages(GFP_ATOMIC, order);
/* we need to guess at the right sort of size for a buffer cache.
the heuristic from working with large databases and getting
fsync times (ext2) manageable, is the following */
memory_size >>= 20;
for (order = 5; (1UL << order) < memory_size; order++);
/* try to allocate something until we get it or we're asking
for something that is really too small */
do {
nr_hash = (1UL << order) * PAGE_SIZE /
sizeof(struct buffer_head *);
hash_table = (struct buffer_head **)
__get_free_pages(GFP_ATOMIC, order);
} while (hash_table == NULL && --order > 4);
if (!hash_table)
panic("Failed to allocate buffer hash table\n");
......
......@@ -54,6 +54,7 @@ EXPORT_SYMBOL(lock_fat);
EXPORT_SYMBOL(unlock_fat);
EXPORT_SYMBOL(fat_dir_ioctl);
EXPORT_SYMBOL(fat_readpage);
EXPORT_SYMBOL(fat_is_binary);
int init_fat_fs(void)
{
......
......@@ -703,8 +703,8 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
if(raw_entry->attr & ATTR_SYS)
if (MSDOS_SB(sb)->options.sys_immutable)
inode->i_flags |= S_IMMUTABLE;
MSDOS_I(inode)->i_binary = is_binary(MSDOS_SB(sb)->options.conversion,
raw_entry->ext);
MSDOS_I(inode)->i_binary =
fat_is_binary(MSDOS_SB(sb)->options.conversion, raw_entry->ext);
MSDOS_I(inode)->i_attrs = raw_entry->attr & ATTR_UNUSED;
/* this is as close to the truth as we can get ... */
inode->i_blksize = MSDOS_SB(sb)->cluster_size*SECTOR_SIZE;
......
......@@ -51,11 +51,11 @@ void fat_fs_panic(struct super_block *s,const char *msg)
/*
* is_binary selects optional text conversion based on the conversion mode and
* the extension part of the file name.
* fat_is_binary selects optional text conversion based on the conversion mode
* and the extension part of the file name.
*/
int is_binary(char conversion,char *extension)
int fat_is_binary(char conversion,char *extension)
{
char *walk;
......
......@@ -713,7 +713,7 @@ static int do_msdos_rename(struct inode *old_dir, char *old_name,
fat_cache_inval_inode(old_inode);
old_inode->i_version = ++event;
MSDOS_I(old_inode)->i_binary =
is_binary(MSDOS_SB(sb)->options.conversion, free_de->ext);
fat_is_binary(MSDOS_SB(sb)->options.conversion, free_de->ext);
old_inode->i_ino = free_ino;
fat_mark_buffer_dirty(sb, free_bh, 1);
old_de->name[0] = DELETED_FLAG;
......
......@@ -6,5 +6,10 @@ bool ' Proprietary file locking' CONFIG_NCPFS_IOCTL_LOCKING
bool ' Clear remove/delete inhibit when needed' CONFIG_NCPFS_STRONG
bool ' Use NFS namespace if available' CONFIG_NCPFS_NFS_NS
bool ' Use LONG (OS/2) namespace if available' CONFIG_NCPFS_OS2_NS
if [ "$CONFIG_NCPFS_OS2_NS" = "y" ]; then
bool ' Lowercase DOS filenames' CONFIG_NCPFS_SMALLDOS
fi
bool ' Allow mounting of volume subdirectories' CONFIG_NCPFS_MOUNT_SUBDIR
# bool ' NDS interserver authentication support' CONFIG_NCPFS_NDS_DOMAINS
bool ' Use Native Language Support' CONFIG_NCPFS_NLS
bool ' Enable symbolic links and execute flags' CONFIG_NCPFS_EXTRAS
......@@ -9,7 +9,7 @@
O_TARGET := ncpfs.o
O_OBJS := dir.o file.o inode.o ioctl.o mmap.o ncplib_kernel.o sock.o \
ncpsign_kernel.o
symlink.o ncpsign_kernel.o
M_OBJS := $(O_TARGET)
# If you want debugging output, please uncomment the following line
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,6 +3,7 @@
*
* Copyright (C) 1995, 1996 by Volker Lendecke
* Modified 1997 Peter Waltenberg, Bill Hawes, David Woodhouse for 2.1 dcache
* Modified 1998 Wolfram Pienkoss for NLS
*
*/
......@@ -17,6 +18,7 @@
#include <linux/ncp.h>
#include <linux/ncp_fs.h>
#include "ncplib_kernel.h"
/* maximum limit for ncp_objectname_ioctl */
......@@ -485,6 +487,69 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
return 0;
}
#endif /* CONFIG_NCPFS_NDS_DOMAINS */
#ifdef CONFIG_NCPFS_NLS
/* Here we are select the iocharset and the codepage for NLS.
* Thanks Petr Vandrovec for idea and many hints.
*/
case NCP_IOC_SETCHARSETS:
if ( (permission(inode, MAY_WRITE) != 0)
&& (current->uid != server->m.mounted_uid))
{
return -EACCES;
}
if (server->root_setuped) return -EBUSY;
{
struct ncp_nls_ioctl user;
struct nls_table *codepage;
struct nls_table *iocharset;
struct nls_table *oldset_io;
struct nls_table *oldset_cp;
if (copy_from_user(&user,
(struct ncp_nls_ioctl*)arg,
sizeof(user))) return -EFAULT;
codepage = NULL;
if (!user.codepage[0]) {
codepage = load_nls_default();
}
else {
codepage = load_nls(user.codepage);
if (! codepage) {
return -EBADRQC;
}
}
iocharset = NULL;
if (user.iocharset[0] == 0) {
iocharset = load_nls_default();
}
else {
iocharset = load_nls(user.iocharset);
if (! iocharset) {
unload_nls(codepage);
return -EBADRQC;
}
}
oldset_cp = server->nls_vol;
server->nls_vol = codepage;
oldset_io = server->nls_io;
server->nls_io = iocharset;
server->nls_charsets = user;
if (oldset_cp) unload_nls(oldset_cp);
if (oldset_io) unload_nls(oldset_io);
return 0;
}
case NCP_IOC_GETCHARSETS: /* not tested */
if (copy_to_user((struct ncp_nls_ioctl*)arg,
&(server->nls_charsets),
sizeof(server->nls_charsets))) return -EFAULT;
return 0;
#endif /* CONFIG_NCPFS_NLS */
default:
return -EINVAL;
}
......
......@@ -238,7 +238,8 @@ NCP_FINFO(inode)->volNumber, NCP_FINFO(inode)->dirEntNum, err);
}
static void ncp_add_handle_path(struct ncp_server *server, __u8 vol_num,
__u32 dir_base, int have_dir_base, char *path)
__u32 dir_base, int have_dir_base,
const char *path)
{
ncp_add_byte(server, vol_num);
ncp_add_dword(server, dir_base);
......@@ -468,12 +469,17 @@ ncp_lookup_volume(struct ncp_server *server, char *volname,
target->nameLen = strlen(volname);
strcpy(target->entryName, volname);
target->attributes = aDIR;
/* set dates to Jan 1, 1986 00:00 */
target->creationTime = target->modifyTime = cpu_to_le16(0x0000);
target->creationDate = target->modifyDate = target->lastAccessDate = cpu_to_le16(0x0C21);
return 0;
}
int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server,
struct inode *dir, __u32 info_mask,
struct nw_modify_dos_info *info)
int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *server,
struct inode *dir,
const char *path,
__u32 info_mask,
const struct nw_modify_dos_info *info)
{
__u8 volnum = NCP_FINFO(dir)->volNumber;
__u32 dirent = NCP_FINFO(dir)->dirEntNum;
......@@ -487,13 +493,22 @@ int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server,
ncp_add_dword(server, info_mask);
ncp_add_mem(server, info, sizeof(*info));
ncp_add_handle_path(server, volnum, dirent, 1, NULL);
ncp_add_handle_path(server, volnum, dirent, 1, path);
result = ncp_request(server, 87);
ncp_unlock_server(server);
return result;
}
int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server,
struct inode *dir,
__u32 info_mask,
const struct nw_modify_dos_info *info)
{
return ncp_modify_file_or_subdir_dos_info_path(server, dir, NULL,
info_mask, info);
}
static int
ncp_DeleteNSEntry(struct ncp_server *server,
__u8 have_dir_base, __u8 volnum, __u32 dirent,
......@@ -788,6 +803,35 @@ ncp_write(struct ncp_server *server, const char *file_id,
return result;
}
#ifdef CONFIG_NCPFS_EXTRAS
int
ncp_read_kernel(struct ncp_server *server, const char *file_id,
__u32 offset, __u16 to_read, char *target, int *bytes_read) {
int error;
mm_segment_t old_fs;
old_fs = get_fs();
set_fs(get_ds());
error = ncp_read(server, file_id, offset, to_read, target, bytes_read);
set_fs(old_fs);
return error;
}
int
ncp_write_kernel(struct ncp_server *server, const char *file_id,
__u32 offset, __u16 to_write,
const char *source, int *bytes_written) {
int error;
mm_segment_t old_fs;
old_fs = get_fs();
set_fs(get_ds());
error = ncp_write(server, file_id, offset, to_write, source, bytes_written);
set_fs(old_fs);
return error;
}
#endif
#ifdef CONFIG_NCPFS_IOCTL_LOCKING
int
ncp_LogPhysicalRecord(struct ncp_server *server, const char *file_id,
......
......@@ -4,6 +4,7 @@
* Copyright (C) 1995, 1996 by Volker Lendecke
* Modified for big endian by J.F. Chadima and David S. Miller
* Modified 1997 Peter Waltenberg, Bill Hawes, David Woodhouse for 2.1 dcache
* Modified 1998 Wolfram Pienkoss for NLS
*
*/
......@@ -23,6 +24,10 @@
#include <asm/unaligned.h>
#include <asm/string.h>
#ifdef CONFIG_NCPFS_NLS
#include <linux/nls.h>
#endif
#include <linux/ncp.h>
#include <linux/ncp_fs.h>
#include <linux/ncp_fs_sb.h>
......@@ -36,12 +41,19 @@ int ncp_close_file(struct ncp_server *, const char *);
int ncp_read(struct ncp_server *, const char *, __u32, __u16, char *, int *);
int ncp_write(struct ncp_server *, const char *, __u32, __u16,
const char *, int *);
#ifdef CONFIG_NCPFS_EXTRAS
int ncp_read_kernel(struct ncp_server *, const char *, __u32, __u16, char *, int *);
int ncp_write_kernel(struct ncp_server *, const char *, __u32, __u16,
const char *, int *);
#endif
int ncp_obtain_info(struct ncp_server *server, struct inode *, char *,
struct nw_info_struct *target);
int ncp_lookup_volume(struct ncp_server *, char *, struct nw_info_struct *);
int ncp_modify_file_or_subdir_dos_info(struct ncp_server *, struct inode *,
__u32, struct nw_modify_dos_info *info);
__u32, const struct nw_modify_dos_info *info);
int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *, struct inode *,
const char* path, __u32, const struct nw_modify_dos_info *info);
int ncp_del_file_or_subdir2(struct ncp_server *, struct dentry*);
int ncp_del_file_or_subdir(struct ncp_server *, struct inode *, char *);
......@@ -75,4 +87,83 @@ int
ncp_mount_subdir(struct ncp_server* server, __u8 volNumber,
__u8 srcNS, __u32 srcDirEntNum);
#endif /* CONFIG_NCPFS_MOUNT_SUBDIR */
#ifdef CONFIG_NCPFS_NLS
/* This are the NLS conversion routines with inspirations and code parts
* from the vfat file system and hints from Petr Vandrovec.
*/
/*
* It should be replaced by charset specifc conversion. Gordon Chaffee
* has prepared some things, but I don't know, what he thinks about it.
* The conversion tables for the io charsets should be generatable by
* Unicode table, shouldn't it? I have written so generation code for it.
* The tables for the vendor specific codepages...? Hmm. The Samba sources
* contains also any hints.
*/
#define toupperif(c, u) ((((u) != 0) && ((c) >= 'a') && ((c) <= 'z')) \
? (c)-('a'-'A') : (c))
#define tolowerif(c, u) ((((u) != 0) && ((c) >= 'A') && ((c) <= 'Z')) \
? (c)-('A'-'a') : (c))
static inline void
io2vol(struct ncp_server *server, char *name, int case_trans)
{
unsigned char nc;
unsigned char *np;
unsigned char *up;
struct nls_unicode uc;
struct nls_table *nls_in;
struct nls_table *nls_out;
nls_in = server->nls_io;
nls_out = server->nls_vol;
np = name;
while (*np)
{
nc = 0;
uc = nls_in->charset2uni[toupperif(*np, case_trans)];
up = nls_out->page_uni2charset[uc.uni2];
if (up != NULL) nc = up[uc.uni1];
if (nc != 0) *np = nc;
np++;
}
}
static inline void
vol2io(struct ncp_server *server, char *name, int case_trans)
{
unsigned char nc;
unsigned char *np;
unsigned char *up;
struct nls_unicode uc;
struct nls_table *nls_in;
struct nls_table *nls_out;
nls_in = server->nls_vol;
nls_out = server->nls_io;
np = name;
while (*np)
{
nc = 0;
uc = nls_in->charset2uni[*np];
up = nls_out->page_uni2charset[uc.uni2];
if (up != NULL) nc = up[uc.uni1];
if (nc == 0) nc = *np;
*np = tolowerif(nc, case_trans);
np++;
}
}
#else
#define io2vol(S,N,U) if (U) str_upper(N)
#define vol2io(S,N,U) if (U) str_lower(N)
#endif /* CONFIG_NCPFS_NLS */
#endif /* _NCPLIB_H */
/*
* linux/fs/ncpfs/symlink.c
*
* Code for allowing symbolic links on NCPFS (i.e. NetWare)
* Symbolic links are not supported on native NetWare, so we use an
* infrequently-used flag (Sh) and store a two-word magic header in
* the file to make sure we don't accidentally use a non-link file
* as a link.
*
* from linux/fs/ext2/symlink.c
*
* Copyright (C) 1998-99, Frank A. Vorstenbosch
*
* ncpfs symlink handling code
* NLS support (c) 1999 Petr Vandrovec
*
*/
#include <linux/config.h>
#ifdef CONFIG_NCPFS_EXTRAS
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/ncp_fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/stat.h>
#include "ncplib_kernel.h"
/* these magic numbers must appear in the symlink file -- this makes it a bit
more resilient against the magic attributes being set on random files. */
#define NCP_SYMLINK_MAGIC0 le32_to_cpu(0x6c6d7973) /* "symlnk->" */
#define NCP_SYMLINK_MAGIC1 le32_to_cpu(0x3e2d6b6e)
static int ncp_readlink(struct dentry *, char *, int);
static struct dentry *ncp_follow_link(struct dentry *, struct dentry *, unsigned int);
int ncp_create_new(struct inode *dir, struct dentry *dentry,
int mode,int attributes);
/*
* symlinks can't do much...
*/
struct inode_operations ncp_symlink_inode_operations={
NULL, /* no file-operations */
NULL, /* create */
NULL, /* lookup */
NULL, /* link */
NULL, /* unlink */
NULL, /* symlink */
NULL, /* mkdir */
NULL, /* rmdir */
NULL, /* mknod */
NULL, /* rename */
ncp_readlink, /* readlink */
ncp_follow_link, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
NULL, /* truncate */
NULL, /* permission */
NULL /* smap */
};
/* ----- follow a symbolic link ------------------------------------------ */
static struct dentry *ncp_follow_link(struct dentry *dentry,
struct dentry *base,
unsigned int follow)
{
struct inode *inode=dentry->d_inode;
int error, length, cnt;
char *link;
#ifdef DEBUG
printk("ncp_follow_link(dentry=%p,base=%p,follow=%u)\n",dentry,base,follow);
#endif
if(!S_ISLNK(inode->i_mode)) {
dput(base);
return ERR_PTR(-EINVAL);
}
if(ncp_make_open(inode,O_RDONLY)) {
dput(base);
return ERR_PTR(-EIO);
}
for (cnt = 0; (link=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE+1, GFP_NFS))==NULL; cnt++) {
if (cnt > 10) {
dput(base);
return ERR_PTR(-EAGAIN); /* -ENOMEM? */
}
schedule();
}
error=ncp_read_kernel(NCP_SERVER(inode),NCP_FINFO(inode)->file_handle,
0,NCP_MAX_SYMLINK_SIZE,link,&length);
if (error!=0 || length<NCP_MIN_SYMLINK_SIZE ||
((__u32 *)link)[0]!=NCP_SYMLINK_MAGIC0 || ((__u32 *)link)[1]!=NCP_SYMLINK_MAGIC1) {
dput(base);
kfree(link);
return ERR_PTR(-EIO);
}
link[length]=0;
vol2io(NCP_SERVER(inode), link+8, 0);
/* UPDATE_ATIME(inode); */
base=lookup_dentry(link+8, base, follow);
kfree(link);
return base;
}
/* ----- read symbolic link ---------------------------------------------- */
static int ncp_readlink(struct dentry * dentry, char * buffer, int buflen)
{
struct inode *inode=dentry->d_inode;
char *link;
int length,error;
#ifdef DEBUG
printk("ncp_readlink(dentry=%p,buffer=%p,buflen=%d)\n",dentry,buffer,buflen);
#endif
if(!S_ISLNK(inode->i_mode))
return -EINVAL;
if(ncp_make_open(inode,O_RDONLY))
return -EIO;
if((link=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE+1,GFP_NFS))==NULL)
return -ENOMEM;
error = ncp_read_kernel(NCP_SERVER(inode),NCP_FINFO(inode)->file_handle,
0,NCP_MAX_SYMLINK_SIZE,link,&length);
if (error!=0 || length < NCP_MIN_SYMLINK_SIZE || buflen < (length-8) ||
((__u32 *)link)[0]!=NCP_SYMLINK_MAGIC0 ||((__u32 *)link)[1]!=NCP_SYMLINK_MAGIC1) {
error = -EIO;
goto out;
}
link[length] = 0;
vol2io(NCP_SERVER(inode), link+8, 0);
error = length - 8;
if(copy_to_user(buffer, link+8, error))
error = -EFAULT;
out:;
kfree(link);
return error;
}
/* ----- create a new symbolic link -------------------------------------- */
int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
int i,length;
struct inode *inode;
char *link;
#ifdef DEBUG
printk("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname);
#endif
if (!(NCP_SERVER(dir)->m.flags & NCP_MOUNT_SYMLINKS))
return -EPERM; /* EPERM is returned by VFS if symlink procedure does not exist */
if ((length=strlen(symname))>NCP_MAX_SYMLINK_SIZE)
return -EINVAL;
if ((link=(char *)kmalloc(length+9,GFP_NFS))==NULL)
return -ENOMEM;
if (ncp_create_new(dir,dentry,0,aSHARED|aHIDDEN)) {
kfree(link);
return -EIO;
}
inode=dentry->d_inode;
((__u32 *)link)[0]=NCP_SYMLINK_MAGIC0;
((__u32 *)link)[1]=NCP_SYMLINK_MAGIC1;
memcpy(link+8, symname, length+1); /* including last zero for io2vol */
/* map to/from server charset, do not touch upper/lower case as
symlink can point out of ncp filesystem */
io2vol(NCP_SERVER(inode), link+8, 0);
if(ncp_write_kernel(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle,
0, length+8, link, &i) || i!=length+8) {
kfree(link);
return -EIO;
}
kfree(link);
return 0;
}
#endif
/* ----- EOF ----- */
......@@ -109,7 +109,7 @@ nfs_dir_open(struct inode *dir, struct file *file)
dfprintk(VFS, "NFS: nfs_dir_open(%s/%s)\n",
dentry->d_parent->d_name.name, dentry->d_name.name);
return nfs_revalidate_inode(NFS_DSERVER(dentry), dentry);
return _nfs_revalidate_inode(NFS_DSERVER(dentry), dentry);
}
static ssize_t
......@@ -439,8 +439,10 @@ parent->d_name.name, dentry->d_name.name);
goto out_bad;
/* Filehandle matches? */
if (memcmp(dentry->d_fsdata, &fhandle, sizeof(struct nfs_fh)))
goto out_bad;
if (memcmp(dentry->d_fsdata, &fhandle, sizeof(struct nfs_fh))) {
if (dentry->d_count < 2 || nfs_revalidate(dentry))
goto out_bad;
}
/* Ok, remeber that we successfully checked it.. */
nfs_renew_times(dentry);
......
......@@ -37,6 +37,7 @@ static ssize_t nfs_file_read(struct file *, char *, size_t, loff_t *);
static ssize_t nfs_file_write(struct file *, const char *, size_t, loff_t *);
static int nfs_file_flush(struct file *);
static int nfs_fsync(struct file *, struct dentry *dentry);
static int nfs_file_open(struct inode *inode, struct file *filp);
static struct file_operations nfs_file_operations = {
NULL, /* lseek - default */
......@@ -46,7 +47,7 @@ static struct file_operations nfs_file_operations = {
NULL, /* select - default */
NULL, /* ioctl - default */
nfs_file_mmap, /* mmap */
NULL, /* no special open is needed */
nfs_file_open, /* open */
nfs_file_flush, /* flush */
NULL, /* release */
nfs_fsync, /* fsync */
......@@ -104,6 +105,19 @@ nfs_file_flush(struct file *file)
return status;
}
/*
* Open the file.
* Just checks the cache is synchronized.
*/
static int
nfs_file_open(struct inode *inode, struct file *filp)
{
struct dentry *dentry = filp->f_dentry;
return _nfs_revalidate_inode(NFS_DSERVER(dentry), dentry);
}
static ssize_t
nfs_file_read(struct file * file, char * buf, size_t count, loff_t *ppos)
{
......
......@@ -234,6 +234,11 @@ nfs_read_super(struct super_block *sb, void *raw_data, int silent)
server->rsize = nfs_block_size(data->rsize, NULL);
server->wsize = nfs_block_size(data->wsize, NULL);
server->flags = data->flags;
if (data->flags & NFS_MOUNT_NOAC) {
data->acregmin = data->acregmax = 0;
data->acdirmin = data->acdirmax = 0;
}
server->acregmin = data->acregmin*HZ;
server->acregmax = data->acregmax*HZ;
server->acdirmin = data->acdirmin*HZ;
......@@ -660,10 +665,6 @@ _nfs_revalidate_inode(struct nfs_server *server, struct dentry *dentry)
int status = 0;
struct nfs_fattr fattr;
/* Don't bother revalidating if we've done it recently */
if (jiffies - NFS_READTIME(inode) < NFS_ATTRTIMEO(inode))
goto out;
dfprintk(PAGECACHE, "NFS: revalidating %s/%s, ino=%ld\n",
dentry->d_parent->d_name.name, dentry->d_name.name,
inode->i_ino);
......
......@@ -4,7 +4,7 @@
# msdos and Joliet want NLS
if [ "$CONFIG_JOLIET" = "y" -o "$CONFIG_FAT_FS" != "n" \
-o "$CONFIG_NTFS_FS" != "n" ]; then
-o "$CONFIG_NTFS_FS" != "n" -o "$CONFIG_NCPFS_NLS" = "y" ]; then
define_bool CONFIG_NLS y
else
define_bool CONFIG_NLS n
......
......@@ -46,7 +46,7 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX
"btsl %1,%0"
:"=m" (ADDR)
:"ir" (nr));
:"Ir" (nr));
}
extern __inline__ void clear_bit(int nr, volatile void * addr)
......@@ -54,7 +54,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX
"btrl %1,%0"
:"=m" (ADDR)
:"ir" (nr));
:"Ir" (nr));
}
extern __inline__ void change_bit(int nr, volatile void * addr)
......@@ -62,7 +62,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX
"btcl %1,%0"
:"=m" (ADDR)
:"ir" (nr));
:"Ir" (nr));
}
extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
......@@ -72,7 +72,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
:"ir" (nr));
:"Ir" (nr));
return oldbit;
}
......@@ -83,7 +83,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
:"ir" (nr));
:"Ir" (nr));
return oldbit;
}
......@@ -94,7 +94,7 @@ extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
:"ir" (nr));
:"Ir" (nr));
return oldbit;
}
......@@ -113,7 +113,7 @@ extern __inline__ int __test_bit(int nr, volatile void * addr)
__asm__ __volatile__(
"btl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit)
:"m" (ADDR),"ir" (nr));
:"m" (ADDR),"Ir" (nr));
return oldbit;
}
......
......@@ -169,7 +169,7 @@ extern int max_super_blocks, nr_super_blocks;
extern void update_atime (struct inode *inode);
#define UPDATE_ATIME(inode) update_atime (inode)
extern void buffer_init(void);
extern void buffer_init(unsigned long);
extern void inode_init(void);
extern void file_table_init(void);
extern void dcache_init(void);
......
......@@ -195,7 +195,7 @@ struct fat_cache {
};
/* misc.c */
extern int is_binary(char conversion,char *extension);
extern int fat_is_binary(char conversion,char *extension);
extern void lock_fat(struct super_block *sb);
extern void unlock_fat(struct super_block *sb);
extern int fat_add_cluster(struct inode *inode);
......
......@@ -3,6 +3,7 @@
*
* Copyright (C) 1995 by Volker Lendecke
* Modified for sparc by J.F. Chadima
* Modified for __constant_ntoh by Frank A. Vorstenbosch
*
*/
......@@ -58,11 +59,21 @@ struct ncp_volume_info {
/* these define the attribute byte as seen by NCP */
#define aRONLY (ntohl(0x01000000))
#define aHIDDEN (ntohl(0x02000000))
#define aSYSTEM (ntohl(0x04000000))
#define aHIDDEN (__constant_ntohl(0x02000000))
#define aSYSTEM (__constant_ntohl(0x04000000))
#define aEXECUTE (ntohl(0x08000000))
#define aDIR (ntohl(0x10000000))
#define aARCH (ntohl(0x20000000))
#define aSHARED (ntohl(0x80000000))
#define aDONTSUBALLOCATE (ntohl(1L<<(11+8)))
#define aTRANSACTIONAL (ntohl(1L<<(12+8)))
#define aPURGE (ntohl(1L<<(16-8)))
#define aRENAMEINHIBIT (ntohl(1L<<(17-8)))
#define aDELETEINHIBIT (ntohl(1L<<(18-8)))
#define aDONTCOMPRESS (nothl(1L<<(27-24)))
#define NCP_MIN_SYMLINK_SIZE 8
#define NCP_MAX_SYMLINK_SIZE 512
#define AR_READ (ntohs(0x0100))
#define AR_WRITE (ntohs(0x0200))
......
......@@ -13,6 +13,15 @@
#include <linux/types.h>
#include <linux/ncp_mount.h>
/* NLS charsets by ioctl */
#define NCP_IOCSNAME_LEN 20
struct ncp_nls_ioctl
{
unsigned char codepage[NCP_IOCSNAME_LEN+1];
unsigned char iocharset[NCP_IOCSNAME_LEN+1];
};
#include <linux/ncp_fs_sb.h>
#include <linux/ncp_fs_i.h>
......@@ -111,6 +120,9 @@ struct ncp_privatedata_ioctl
#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
#define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl)
#define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl)
/*
* The packet size to allocate. One page should be enough.
*/
......@@ -155,6 +167,12 @@ struct ncpfs_i {
__u32 dirEntNum __attribute__((packed));
__u32 DosDirNum __attribute__((packed));
__u32 volNumber __attribute__((packed));
#ifdef CONFIG_NCPFS_SMALLDOS
__u32 origNS;
#endif
#ifdef CONFIG_NCPFS_STRONG
__u32 nwattr;
#endif
int opened;
int access;
__u32 server_file_handle __attribute__((packed));
......@@ -272,10 +290,13 @@ static inline int ncp_namespace(struct inode *inode)
return server->name_space[NCP_FINFO(inode)->volNumber];
}
static inline int ncp_preserve_case(struct inode *i)
{
static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator) {
#if defined(CONFIG_NCPFS_NFS_NS) || defined(CONFIG_NCPFS_OS2_NS)
int ns = ncp_namespace(i);
#endif
#if defined(CONFIG_NCPFS_SMALLDOS) && defined(CONFIG_NCPFS_OS2_NS)
if ((ns == NW_NS_OS2) && (nscreator == NW_NS_DOS))
return 0;
#endif
return
#ifdef CONFIG_NCPFS_OS2_NS
......@@ -287,6 +308,11 @@ static inline int ncp_preserve_case(struct inode *i)
0;
}
static inline int ncp_preserve_case(struct inode *i)
{
return ncp_preserve_entry_case(i, NW_NS_OS2);
}
static inline int ncp_case_sensitive(struct inode *i)
{
#ifdef CONFIG_NCPFS_NFS_NS
......
......@@ -73,6 +73,10 @@ struct ncp_server {
size_t len;
void* data;
} priv;
struct ncp_nls_ioctl nls_charsets; /* NLS user data */
struct nls_table *nls_vol; /* codepage used on volume */
struct nls_table *nls_io; /* charset used for input and display */
};
static inline int ncp_conn_valid(struct ncp_server *server)
......
......@@ -16,11 +16,13 @@
#define NCP_MOUNT_VERSION 3
/* Values for flags */
#define NCP_MOUNT_SOFT 0x0001
#define NCP_MOUNT_INTR 0x0002
#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */
#define NCP_MOUNT_NO_OS2 0x0008
#define NCP_MOUNT_NO_NFS 0x0010
#define NCP_MOUNT_SOFT 0x0001
#define NCP_MOUNT_INTR 0x0002
#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */
#define NCP_MOUNT_NO_OS2 0x0008 /* do not use OS/2 (LONG) namespace */
#define NCP_MOUNT_NO_NFS 0x0010 /* do not use NFS namespace */
#define NCP_MOUNT_EXTRAS 0x0020
#define NCP_MOUNT_SYMLINKS 0x0040 /* enable symlinks */
struct ncp_mount_data {
int version;
......
......@@ -20,8 +20,6 @@ static inline unsigned long page_address(struct page * page)
#define PAGE_HASH_BITS 12
#define PAGE_HASH_SIZE (1 << PAGE_HASH_BITS)
#define PAGE_AGE_VALUE 16
extern unsigned long page_cache_size; /* # of pages currently in the hash table */
extern struct page * page_hash_table[PAGE_HASH_SIZE];
......
......@@ -927,6 +927,9 @@
#define PCI_VENDOR_ID_CCUBE 0x123f
#define PCI_VENDOR_ID_AVM 0x1244
#define PCI_DEVICE_ID_AVM_A1 0x0a00
#define PCI_VENDOR_ID_DIPIX 0x1246
#define PCI_VENDOR_ID_STALLION 0x124d
......
......@@ -1166,7 +1166,7 @@ asmlinkage void __init start_kernel(void)
filescache_init();
dcache_init();
vma_init();
buffer_init();
buffer_init(memory_end-memory_start);
signals_init();
inode_init();
file_table_init();
......
......@@ -33,7 +33,7 @@ int nr_free_pages = 0;
for the ring buffers */
#define NR_MEM_LISTS 12
#else
#define NR_MEM_LISTS 6
#define NR_MEM_LISTS 10
#endif
/* The start of this MUST match the start of "struct page" */
......
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