From 88e12acf949f6c0f3d373aadbf687eb8730b6238 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:19:08 -0500 Subject: [PATCH] Import 2.2.10 --- Documentation/Configure.help | 90 +++++++++++++++++------ arch/sparc/kernel/signal.c | 3 +- arch/sparc64/kernel/ioctl32.c | 24 ++++++- arch/sparc64/kernel/signal.c | 3 +- arch/sparc64/kernel/signal32.c | 3 +- fs/Config.in | 3 - fs/smbfs/inode.c | 5 -- fs/smbfs/proc.c | 128 +++++++++++++++++++-------------- include/asm-sparc/spinlock.h | 2 +- include/asm-sparc64/spinlock.h | 2 +- include/linux/smb.h | 2 +- include/linux/smb_fs.h | 16 +++++ 12 files changed, 190 insertions(+), 91 deletions(-) diff --git a/Documentation/Configure.help b/Documentation/Configure.help index 953cd74e2501..717e8c154bf3 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -5228,7 +5228,7 @@ CONFIG_NET_FASTROUTE section (except for CONFIG_IP_ROUTE_TOS and CONFIG_IP_ROUTE_FWMARK). At the moment, few devices support fast switching (tulip is one of them, modified 8390 can be found at - ftp://ftp.inr.ac.ru/ip-routing/fastroute-8390.tar.gz). + ftp://ftp.inr.ac.ru/ip-routing/fastroute/fastroute-8390.tar.gz). If unsure, say N. @@ -5238,8 +5238,8 @@ CONFIG_NET_HW_FLOWCONTROL during periods of extremal congestion. At the moment only a couple of device drivers support it (really only one -- tulip, modified 8390 can be found at - ftp://ftp.inr.ac.ru/ip-routing/fastroute-8390.tar.gz). Really, this - option is applicable to any machine attached to a fast enough + ftp://ftp.inr.ac.ru/ip-routing/fastroute/fastroute-8390.tar.gz). + Really, this option is applicable to any machine attached to a fast enough network, and even a 10 Mb NIC is able to kill a not very slow box, such as a 120MHz Pentium. @@ -6546,16 +6546,6 @@ CONFIG_HIPPI under Linux, say Y here (you must also remember to enable the driver for your HIPPI card below). Most people will say N here. -CERN HIPPI PCI adapter support -CONFIG_CERN_HIPPI - Say Y here if this is your PCI HIPPI network card. - - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called cern_hippi.o. If you want to compile it as - a module, say M here and read Documentation/modules.txt. If unsure, - say N. - Essential RoadRunner HIPPI PCI adapter support CONFIG_ROADRUNNER Say Y here if this is your PCI HIPPI network card. @@ -6656,9 +6646,6 @@ CONFIG_MCD (PhotoCDs). There is a new driver (next question) which can do this. If you want that one, say N here. - If the driver doesn't work out of the box, you might want to have a - look at drivers/cdrom/mcd.h. - If you say Y here, you should also say Y or M to "ISO 9660 CDROM filesystem support" below, because that's the filesystem used on CDROMs. @@ -7492,13 +7479,6 @@ CONFIG_SMB_FS want), say M here and read Documentation/modules.txt. The module will be called smbfs.o. Most people say N, however. -SMB Win95 bug work-around -CONFIG_SMB_WIN95 - If you want to connect to a share exported by Windows 95, you should - say Y here. The Windows 95 server contains a bug that makes listing - directories unreliable. This option slows down the listing of - directories. This makes the Windows 95 server a bit more stable. - Coda filesystem support CONFIG_CODA_FS Coda is an advanced network filesystem, similar to NFS in that it @@ -10791,6 +10771,30 @@ CONFIG_RADIO_AZTECH_PORT haven't changed the setting of jumper JP3 on the card. Removing the jumper sets the card to 0x358. +ADS Cadet AM/FM Radio Tuner Card +CONFIG_RADIO_CADET + Choose Y here if you have one of these AM/FM radio cards, and then fill + in the port address below. + + In order to control your radio card, you will need to use programs + that are compatible with the Video for Linux API. Information on + this API and pointers to "v4l" programs may be found on the WWW at + http://roadrunner.swansea.uk.linux.org/v4l.shtml; to browse the WWW, + you need to have access to a machine on the Internet that has a + program like lynx or netscape. + + Further documentation on this driver can be found on the WWW at + http://linux.blackhawke.net/cadet.html. + + If you want to compile this driver as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read Documentation/modules.txt. The module will be + called radio-cadet.o. + +ADS Cadet AM/FM Radio Tuner Card I/O Port +CONFIG_RADIO_CADET_PORT + Enter the I/O address of the card here (most commonly 330). + SF16FMI Radio CONFIG_RADIO_SF16FMI Choose Y here if you have one of these FM radio cards, and then fill @@ -10973,6 +10977,15 @@ CONFIG_VIDEO_PMS from the running kernel whenever you want). If you want to compile it as a module, say M here and read Documentation/modules.txt. +PlanB Video-In for PowerMacs +CONFIG_VIDEO_PLANB + PlanB is the V4L driver for the PowerMac 7x00/8x00 series video + input hardware. If you want to experiment with this, say Y. + Otherwise, or if you don't understand a word, say N. + See http://www.cpu.lu/~mlan/planb.html for more info. + + Saying M will compile this driver as a module (planb.o). + # # ARM options # @@ -11270,6 +11283,21 @@ CONFIG_IRTTY_SIR If unsure, say Y. +IrPORT IrDA Device Driver +CONFIG_IRPORT_SIR + Say Y here if you want to build support for the IrPORT IrDA device + driver. If you want to compile it as a module, say M here and + read Documentation/modules.txt. IrPORT can be used instead of + IrTTY and sometimes this can be better. One example is if your + IrDA port does not have echo-canceling, which will work OK with + IrPORT since this driver is working in half-duplex mode only. You + don't need to use irattach with IrPORT, but you just insert it + the same way as FIR drivers (insmod irport io=0x3e8 irq=11). + Notice that IrPORT is a SIR device driver which means that speed + is limited to 115200 bps. + + If unsure, say Y. + Winbond W83977AF IrDA Device Driver CONFIG_WINBOND_FIR Say Y here if you want to build IrDA support for the Winbond @@ -11293,6 +11321,13 @@ CONFIG_SHARP_FIR read Documentation/modules.txt. This chipset is used by the Toshiba Tecra laptops. +Toshiba Type-O IR Port Device Driver +CONFIG_TOSHIBA_FIR + Say Y here if you want to build support for the Toshiba Type-O IR + chipset. If you want to compile it as a module, say M here and + read Documentation/modules.txt. This chipset is used by the Toshiba + Libretto 100CT, and many more laptops. + ESI JetEye PC Dongle CONFIG_ESI_DONGLE Say Y here if you want to build support for the Extended Systems @@ -11330,6 +11365,15 @@ CONFIG_GIRBIL_DONGLE by IrTTY. To activate support for Greenwich dongles you will have to insert "irattach -d girbil" in the /etc/irda/drivers script. +Parallax Litelink dongle +CONFIG_LITELINK_DONGLE + Say Y here if you want to build support for the Parallax Litelink + dongle. If you want to compile it as a module, say M here and read + Documentation/modules.txt. The Parallax dongle attaches to the + normal 9-pin serial port connector, and can currently only be used + by IrTTY. To activate support for Parallax dongles you will have to + insert "irattach -d litelink" in the /etc/irda/drivers script. + VME (Motorola and BVM) support CONFIG_VME Say Y here if you want to build a kernel for a 680x0 based VME diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c index e6023f43b2ce..9a62d931d36e 100644 --- a/arch/sparc/kernel/signal.c +++ b/arch/sparc/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.91 1999/01/26 11:00:44 jj Exp $ +/* $Id: signal.c,v 1.91.2.1 1999/06/14 00:36:13 davem Exp $ * linux/arch/sparc/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -1194,6 +1194,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, default: lock_kernel(); sigaddset(¤t->signal, signr); + recalc_sigpending(current); current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOT REACHED */ diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index 84d4de363cfc..5caa558b9498 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.62 1999/05/01 09:17:44 davem Exp $ +/* $Id: ioctl32.c,v 1.62.2.1 1999/06/09 04:53:03 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -37,6 +37,7 @@ #include #include #include +#include #include /* Ugly hack. */ @@ -417,6 +418,23 @@ struct ifconf32 { __kernel_caddr_t32 ifcbuf; }; +static int dev_ifname32(unsigned int fd, unsigned long arg) +{ + struct device *dev; + struct ifreq32 ifr32; + int err; + + if (copy_from_user(&ifr32, (struct ifreq32 *)arg, sizeof(struct ifreq32))) + return -EFAULT; + + dev = dev_get_by_index(ifr32.ifr_ifindex); + if (!dev) + return -ENODEV; + + err = copy_to_user((struct ifreq32 *)arg, &ifr32, sizeof(struct ifreq32)); + return (err ? -EFAULT : 0); +} + static inline int dev_ifconf(unsigned int fd, unsigned long arg) { struct ifconf32 ifc32; @@ -1687,6 +1705,10 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) goto out; } switch (cmd) { + case SIOCGIFNAME: + error = dev_ifname32(fd, arg); + goto out; + case SIOCGIFCONF: error = dev_ifconf(fd, arg); goto out; diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index 91dc7224d8c7..7ac8f8a4ab7b 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.38 1998/10/16 03:19:04 davem Exp $ +/* $Id: signal.c,v 1.38.2.1 1999/06/14 00:36:21 davem Exp $ * arch/sparc64/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -950,6 +950,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, default: lock_kernel(); sigaddset(¤t->signal, signr); + recalc_sigpending(current); current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOT REACHED */ diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index d425132fdc04..5834cfcfc035 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c @@ -1,4 +1,4 @@ -/* $Id: signal32.c,v 1.47 1998/10/13 09:07:40 davem Exp $ +/* $Id: signal32.c,v 1.47.2.1 1999/06/14 00:36:24 davem Exp $ * arch/sparc64/kernel/signal32.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -1336,6 +1336,7 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs * regs, default: lock_kernel(); sigaddset(¤t->signal, signr); + recalc_sigpending(current); current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOT REACHED */ diff --git a/fs/Config.in b/fs/Config.in index 8d71cc16e289..73448beb43f5 100644 --- a/fs/Config.in +++ b/fs/Config.in @@ -86,9 +86,6 @@ if [ "$CONFIG_INET" = "y" ]; then fi fi tristate 'SMB filesystem support (to mount WfW shares etc.)' CONFIG_SMB_FS - if [ "$CONFIG_SMB_FS" != "n" ]; then - bool 'SMB Win95 bug work-around' CONFIG_SMB_WIN95 - fi fi if [ "$CONFIG_IPX" != "n" -o "$CONFIG_INET" != "n" ]; then tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c index cfdf49f6e2f5..65eee4850c28 100644 --- a/fs/smbfs/inode.c +++ b/fs/smbfs/inode.c @@ -376,9 +376,6 @@ smb_read_super(struct super_block *sb, void *raw_data, int silent) *mnt = *((struct smb_mount_data *) raw_data); /* ** temp ** pass config flags in file mode */ mnt->version = (mnt->file_mode >> 9); -#ifdef CONFIG_SMB_WIN95 - mnt->version |= SMB_FIX_WIN95; -#endif mnt->file_mode &= (S_IRWXU | S_IRWXG | S_IRWXO); mnt->file_mode |= S_IFREG; mnt->dir_mode &= (S_IRWXU | S_IRWXG | S_IRWXO); @@ -387,8 +384,6 @@ smb_read_super(struct super_block *sb, void *raw_data, int silent) /* * Display the enabled options */ - if (mnt->version & SMB_FIX_WIN95) - printk("SMBFS: Win 95 bug fixes enabled\n"); if (mnt->version & SMB_FIX_OLDATTR) printk("SMBFS: Using core getattr (Win 95 speedup)\n"); else if (mnt->version & SMB_FIX_DIRATTR) diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c index 42981d4836f7..06cd5dda9a77 100644 --- a/fs/smbfs/proc.c +++ b/fs/smbfs/proc.c @@ -39,6 +39,9 @@ #define SMB_DIRINFO_SIZE 43 #define SMB_STATUS_SIZE 21 +/* yes, this deliberately has two parts */ +#define DENTRY_PATH(dentry) (dentry)->d_parent->d_name.name,(dentry)->d_name.name + static int smb_proc_setattr_ext(struct smb_sb_info *, struct inode *, struct smb_fattr *); static inline int @@ -174,24 +177,22 @@ static int day_n[] = /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */ -extern struct timezone sys_tz; - static time_t -utc2local(time_t time) +utc2local(struct smb_sb_info *server, time_t time) { - return time - sys_tz.tz_minuteswest * 60 - (sys_tz.tz_dsttime ? 3600 :0); + return time - server->opt.serverzone*60; } static time_t -local2utc(time_t time) +local2utc(struct smb_sb_info *server, time_t time) { - return time + sys_tz.tz_minuteswest * 60 + (sys_tz.tz_dsttime ? 3600 : 0); + return time + server->opt.serverzone*60; } /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */ static time_t -date_dos2unix(__u16 date, __u16 time) +date_dos2unix(struct smb_sb_info *server, __u16 date, __u16 time) { int month, year; time_t secs; @@ -202,18 +203,19 @@ date_dos2unix(__u16 date, __u16 time) ((date & 31) - 1 + day_n[month] + (year / 4) + year * 365 - ((year & 3) == 0 && month < 2 ? 1 : 0) + 3653); /* days since 1.1.70 plus 80's leap day */ - return local2utc(secs); + return local2utc(server, secs); } /* Convert linear UNIX date to a MS-DOS time/date pair. */ static void -date_unix2dos(int unix_date, __u16 *date, __u16 *time) +date_unix2dos(struct smb_sb_info *server, + int unix_date, __u16 *date, __u16 *time) { int day, year, nl_day, month; - unix_date = utc2local(unix_date); + unix_date = utc2local(server, unix_date); *time = (unix_date % 60) / 2 + (((unix_date / 60) % 60) << 5) + (((unix_date / 3600) % 24) << 11); @@ -355,6 +357,11 @@ smb_errno(struct smb_sb_info *server) int error = server->err; char *class = "Unknown"; +#ifdef SMBFS_DEBUG_VERBOSE + printk("smb_errno: errcls %d code %d from command 0x%x\n", + errcls, error, SMB_CMD(server->packet)); +#endif + if (errcls == ERRDOS) switch (error) { @@ -456,7 +463,7 @@ smb_errno(struct smb_sb_info *server) class = "ERRCMD"; err_unknown: - printk("smb_errno: class %s, code %d from command %x\n", + printk("smb_errno: class %s, code %d from command 0x%x\n", class, error, SMB_CMD(server->packet)); return EIO; } @@ -646,9 +653,27 @@ printk("smb_newconn: fd=%d, pid=%d\n", opt->fd, current->pid); server->generation += 1; server->state = CONN_VALID; error = 0; + + /* check if we have an old smbmount that uses seconds for the + serverzone */ + if (server->opt.serverzone > 12*60 || server->opt.serverzone < -12*60) + server->opt.serverzone /= 60; + + /* now that we have an established connection we can detect the server + type and enable bug workarounds */ + if (server->opt.protocol == SMB_PROTOCOL_NT1 && + (server->opt.max_xmit < 0x1000) && + !(server->opt.capabilities & SMB_CAP_NT_SMBS)) { + server->mnt->version |= SMB_FIX_WIN95; +#ifdef SMBFS_DEBUG_VERBOSE + printk("smb_newconn: detected WIN95 server\n"); +#endif + } + #ifdef SMBFS_DEBUG_VERBOSE -printk("smb_newconn: protocol=%d, max_xmit=%d, pid=%d\n", -server->opt.protocol, server->opt.max_xmit, server->conn_pid); +printk("smb_newconn: protocol=%d, max_xmit=%d, pid=%d capabilities=0x%x\n", + server->opt.protocol, server->opt.max_xmit, server->conn_pid, + server->opt.capabilities); #endif out: @@ -755,7 +780,7 @@ smb_proc_open(struct smb_sb_info *server, struct dentry *dentry, int wish) { #ifdef SMBFS_DEBUG_VERBOSE printk("smb_proc_open: %s/%s R/W failed, error=%d, retrying R/O\n", -dentry->d_parent->d_name.name, dentry->d_name.name, error); + DENTRY_PATH(dentry), error); #endif mode = read_only; goto retry; @@ -789,7 +814,7 @@ smb_open(struct dentry *dentry, int wish) if (!inode) { printk("smb_open: no inode for dentry %s/%s\n", - dentry->d_parent->d_name.name, dentry->d_name.name); + DENTRY_PATH(dentry)); goto out; } @@ -810,7 +835,7 @@ smb_open(struct dentry *dentry, int wish) { #ifdef SMBFS_PARANOIA printk("smb_open: %s/%s open failed, result=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, result); + DENTRY_PATH(dentry), result); #endif goto out; } @@ -829,8 +854,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, result); { #ifdef SMBFS_PARANOIA printk("smb_open: %s/%s access denied, access=%x, wish=%x\n", -dentry->d_parent->d_name.name, dentry->d_name.name, -inode->u.smbfs_i.access, wish); + DENTRY_PATH(dentry), inode->u.smbfs_i.access, wish); #endif result = -EACCES; } @@ -845,7 +869,7 @@ smb_proc_close(struct smb_sb_info *server, __u16 fileid, __u32 mtime) { smb_setup_header(server, SMBclose, 3, 0); WSET(server->packet, smb_vwv0, fileid); - DSET(server->packet, smb_vwv1, utc2local(mtime)); + DSET(server->packet, smb_vwv1, utc2local(server, mtime)); return smb_request_ok(server, SMBclose, 0, 0); } @@ -946,7 +970,7 @@ smb_close_dentry(struct dentry * dentry) { #ifdef SMBFS_DEBUG_VERBOSE printk("smb_close_dentry: closing %s/%s, count=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_count); + DENTRY_PATH(dentry), dentry->d_count); #endif smb_proc_close_inode(server, ino); } @@ -954,7 +978,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_count); } #ifdef SMBFS_DEBUG_VERBOSE printk("smb_close_dentry: closed %s/%s, count=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_count); + DENTRY_PATH(dentry), dentry->d_count); #endif } } @@ -1014,7 +1038,7 @@ smb_proc_read(struct dentry *dentry, off_t offset, int count, char *data) out: #ifdef SMBFS_DEBUG_VERBOSE printk("smb_proc_read: file %s/%s, count=%d, result=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, count, result); + DENTRY_PATH(dentry), count, result); #endif smb_unlock_server(server); return result; @@ -1029,8 +1053,7 @@ smb_proc_write(struct dentry *dentry, off_t offset, int count, const char *data) #if SMBFS_DEBUG_VERBOSE printk("smb_proc_write: file %s/%s, count=%d@%ld, packet_size=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, -count, offset, server->packet_size); + DENTRY_PATH(dentry), count, offset, server->packet_size); #endif smb_lock_server(server); p = smb_setup_header(server, SMBwrite, 5, count + 3); @@ -1063,7 +1086,7 @@ smb_proc_create(struct dentry *dentry, __u16 attr, time_t ctime, __u16 *fileid) retry: p = smb_setup_header(server, SMBcreate, 3, 0); WSET(server->packet, smb_vwv0, attr); - DSET(server->packet, smb_vwv1, utc2local(ctime)); + DSET(server->packet, smb_vwv1, utc2local(server, ctime)); *p++ = 4; p = smb_encode_path(server, p, dentry, NULL); smb_setup_bcc(server, p); @@ -1323,7 +1346,7 @@ smb_proc_readdir_short(struct smb_sb_info *server, struct dentry *dir, int fpos, #ifdef SMBFS_DEBUG_VERBOSE printk("smb_proc_readdir_short: %s/%s, pos=%d\n", -dir->d_parent->d_name.name, dir->d_name.name, fpos); + DENTRY_PATH(dir), fpos); #endif smb_lock_server(server); @@ -1804,15 +1827,15 @@ mask, resp_data_len, WVAL(resp_param, 2)); */ date = WVAL(resp_data, 0); time = WVAL(resp_data, 2); - fattr->f_ctime = date_dos2unix(date, time); + fattr->f_ctime = date_dos2unix(server, date, time); date = WVAL(resp_data, 4); time = WVAL(resp_data, 6); - fattr->f_atime = date_dos2unix(date, time); + fattr->f_atime = date_dos2unix(server, date, time); date = WVAL(resp_data, 8); time = WVAL(resp_data, 10); - fattr->f_mtime = date_dos2unix(date, time); + fattr->f_mtime = date_dos2unix(server, date, time); #ifdef SMBFS_DEBUG_VERBOSE printk("smb_proc_getattr_ff: name=%s, date=%x, time=%x, mtime=%ld\n", mask, date, time, fattr->f_mtime); @@ -1831,7 +1854,7 @@ out: */ static int smb_proc_getattr_core(struct smb_sb_info *server, struct dentry *dir, - struct smb_fattr *fattr) + struct smb_fattr *fattr) { int result; char *p; @@ -1849,13 +1872,13 @@ smb_proc_getattr_core(struct smb_sb_info *server, struct dentry *dir, goto out; } fattr->attr = WVAL(server->packet, smb_vwv0); - fattr->f_mtime = local2utc(DVAL(server->packet, smb_vwv1)); + fattr->f_mtime = local2utc(server, DVAL(server->packet, smb_vwv1)); fattr->f_size = DVAL(server->packet, smb_vwv3); fattr->f_ctime = fattr->f_mtime; fattr->f_atime = fattr->f_mtime; #ifdef SMBFS_DEBUG_TIMESTAMP printk("getattr_core: %s/%s, mtime=%ld\n", -dir->d_name.name, name->name, fattr->f_mtime); + DENTRY_PATH(dir), fattr->f_mtime); #endif result = 0; @@ -1926,18 +1949,18 @@ printk("smb_proc_getattr_trans2: not enough data for %s, len=%d\n", } date = WVAL(resp_data, off_date); time = WVAL(resp_data, off_time); - attr->f_ctime = date_dos2unix(date, time); + attr->f_ctime = date_dos2unix(server, date, time); date = WVAL(resp_data, 4 + off_date); time = WVAL(resp_data, 4 + off_time); - attr->f_atime = date_dos2unix(date, time); + attr->f_atime = date_dos2unix(server, date, time); date = WVAL(resp_data, 8 + off_date); time = WVAL(resp_data, 8 + off_time); - attr->f_mtime = date_dos2unix(date, time); + attr->f_mtime = date_dos2unix(server, date, time); #ifdef SMBFS_DEBUG_TIMESTAMP printk("getattr_trans2: %s/%s, date=%x, time=%x, mtime=%ld\n", -dir->d_name.name, name->name, date, time, attr->f_mtime); + DENTRY_PATH(dir), date, time, attr->f_mtime); #endif attr->f_size = DVAL(resp_data, 12); attr->attr = WVAL(resp_data, 20); @@ -1980,6 +2003,7 @@ smb_proc_getattr(struct dentry *dir, struct smb_fattr *fattr) return result; } + /* * Called with the server locked. Because of bugs in the * core protocol, we use this only to set attributes. See @@ -1994,7 +2018,7 @@ smb_proc_getattr(struct dentry *dir, struct smb_fattr *fattr) */ static int smb_proc_setattr_core(struct smb_sb_info *server, struct dentry *dentry, - __u16 attr) + __u16 attr) { char *p; int result; @@ -2009,11 +2033,6 @@ smb_proc_setattr_core(struct smb_sb_info *server, struct dentry *dentry, WSET(server->packet, smb_vwv6, 0); WSET(server->packet, smb_vwv7, 0); *p++ = 4; - /* - * Samba uses three leading '\', so we'll do it too. - */ - *p++ = '\\'; - *p++ = '\\'; p = smb_encode_path(server, p, dentry, NULL); *p++ = 4; *p++ = 0; @@ -2044,7 +2063,7 @@ smb_proc_setattr(struct dentry *dir, struct smb_fattr *fattr) #ifdef SMBFS_DEBUG_VERBOSE printk("smb_proc_setattr: setting %s/%s, open=%d\n", -dir->d_parent->d_name.name, dir->d_name.name, smb_is_open(dir->d_inode)); + DENTRY_PATH(dir), smb_is_open(dir->d_inode)); #endif smb_lock_server(server); result = smb_proc_setattr_core(server, dir, fattr->attr); @@ -2069,10 +2088,10 @@ smb_proc_setattr_ext(struct smb_sb_info *server, /* We don't change the creation time */ WSET(server->packet, smb_vwv1, 0); WSET(server->packet, smb_vwv2, 0); - date_unix2dos(fattr->f_atime, &date, &time); + date_unix2dos(server, fattr->f_atime, &date, &time); WSET(server->packet, smb_vwv3, date); WSET(server->packet, smb_vwv4, time); - date_unix2dos(fattr->f_mtime, &date, &time); + date_unix2dos(server, fattr->f_mtime, &date, &time); WSET(server->packet, smb_vwv5, date); WSET(server->packet, smb_vwv6, time); #ifdef SMBFS_DEBUG_TIMESTAMP @@ -2119,15 +2138,15 @@ smb_proc_setattr_trans2(struct smb_sb_info *server, WSET(data, 0, 0); /* creation time */ WSET(data, 2, 0); - date_unix2dos(fattr->f_atime, &date, &time); + date_unix2dos(server, fattr->f_atime, &date, &time); WSET(data, 4, date); WSET(data, 6, time); - date_unix2dos(fattr->f_mtime, &date, &time); + date_unix2dos(server, fattr->f_mtime, &date, &time); WSET(data, 8, date); WSET(data, 10, time); #ifdef SMBFS_DEBUG_TIMESTAMP printk("setattr_trans2: %s/%s, date=%x, time=%x, mtime=%ld\n", -dir->d_parent->d_name.name, dir->d_name.name, date, time, fattr->f_mtime); + DENTRY_PATH(dir), date, time, fattr->f_mtime); #endif DSET(data, 12, 0); /* size */ DSET(data, 16, 0); /* blksize */ @@ -2174,10 +2193,12 @@ smb_proc_settime(struct dentry *dentry, struct smb_fattr *fattr) #ifdef SMBFS_DEBUG_VERBOSE printk("smb_proc_settime: setting %s/%s, open=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, smb_is_open(inode)); + DENTRY_PATH(dentry), smb_is_open(inode)); #endif smb_lock_server(server); - if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2) + /* setting the time on a Win95 server fails (tridge) */ + if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2 && + !(server->mnt->version & SMB_FIX_WIN95)) { if (smb_is_open(inode) && inode->u.smbfs_i.access != SMB_O_RDONLY) @@ -2194,12 +2215,13 @@ dentry->d_parent->d_name.name, dentry->d_name.name, smb_is_open(inode)); { /* * Set the mtime by opening and closing the file. + * Note that the file is opened read-only, but this + * still allows us to set the date (tridge) */ result = -EACCES; if (!smb_is_open(inode)) - smb_proc_open(server, dentry, SMB_O_WRONLY); - if (smb_is_open(inode) && - inode->u.smbfs_i.access != SMB_O_RDONLY) + smb_proc_open(server, dentry, SMB_O_RDONLY); + if (smb_is_open(inode)) { inode->i_mtime = fattr->f_mtime; result = smb_proc_close_inode(server, inode); diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h index c676dcc4c8f6..2a7da55ba06b 100644 --- a/include/asm-sparc/spinlock.h +++ b/include/asm-sparc/spinlock.h @@ -17,7 +17,7 @@ typedef unsigned char spinlock_t; #define spin_lock_init(lock) do { } while(0) #define spin_lock(lock) do { } while(0) -#define spin_trylock(lock) do { } while(0) +#define spin_trylock(lock) (1) #define spin_unlock_wait(lock) do { } while(0) #define spin_unlock(lock) do { } while(0) #define spin_lock_irq(lock) cli() diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index 1d3b3502033e..aaf107053b24 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -15,7 +15,7 @@ typedef unsigned char spinlock_t; #define spin_lock_init(lock) do { } while(0) #define spin_lock(lock) do { } while(0) -#define spin_trylock(lock) do { } while(0) +#define spin_trylock(lock) (1) #define spin_unlock_wait(lock) do { } while(0) #define spin_unlock(lock) do { } while(0) #define spin_lock_irq(lock) cli() diff --git a/include/linux/smb.h b/include/linux/smb.h index 8953686b07ad..852d5b0dd89c 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h @@ -57,7 +57,7 @@ struct smb_conn_opt { /* The following are NT LM 0.12 options */ __u32 maxraw; __u32 capabilities; - __u16 serverzone; + __s16 serverzone; }; #ifdef __KERNEL__ diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index a151a75e6640..11dfce7ddba0 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h @@ -77,6 +77,22 @@ smb_vfree(void *obj) #define SMB_FIX_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */ #define SMB_FIX_DIRATTR 0x0004 /* Use find_first for getattr */ + +/* NT1 protocol capability bits */ +#define SMB_CAP_RAW_MODE 0x0001 +#define SMB_CAP_MPX_MODE 0x0002 +#define SMB_CAP_UNICODE 0x0004 +#define SMB_CAP_LARGE_FILES 0x0008 +#define SMB_CAP_NT_SMBS 0x0010 +#define SMB_CAP_RPC_REMOTE_APIS 0x0020 +#define SMB_CAP_STATUS32 0x0040 +#define SMB_CAP_LEVEL_II_OPLOCKS 0x0080 +#define SMB_CAP_LOCK_AND_READ 0x0100 +#define SMB_CAP_NT_FIND 0x0200 +#define SMB_CAP_DFS 0x1000 +#define SMB_CAP_LARGE_READX 0x4000 + + /* linux/fs/smbfs/mmap.c */ int smb_mmap(struct file *, struct vm_area_struct *); -- 2.39.5