Commit e6b70e9c authored by Vitaly Lipatov's avatar Vitaly Lipatov Committed by Automatic Converter

1.48a-alt3

- WINE@Etersoft 1.0.7 beta - fix inode revalidate for read requests - fix build module scripts
parent 695c3008
......@@ -13,7 +13,7 @@
Name: linux-cifs
Version: 1.48a
%define relnum 1
%define relnum 3
Summary: Advanced Common Internet File System for Linux with Etersoft extension
......@@ -31,7 +31,13 @@ Source1: http://pserver.samba.org/samba/ftp/cifs-cvs/cifs-%version.tar.bz2
Release: alt%relnum
BuildRequires: rpm-build-compat >= 0.7
BuildRequires: kernel-build-tools
BuildRequires: kernel-headers-modules-std-smp kernel-headers-modules-std-pae kernel-headers-modules-wks-smp kernel-headers-modules-ovz-smp
BuildRequires: kernel-headers-modules-std-smp kernel-headers-modules-wks-smp kernel-headers-modules-ovz-smp
%ifarch x86_64
# Don't know if ifnarch exist
BuildRequires: kernel-headers-modules-std-smp
%else
BuildRequires: kernel-headers-modules-std-pae
%endif
%else
Release: eter%relnum%_vendor
BuildRequires: rpm-build-altlinux-compat >= 0.7
......@@ -78,8 +84,8 @@ This package has Etersoft's patches for WINE@Etersoft sharing access support.
%prep
%setup -q
tar xvfj %SOURCE1
patch -p1 -d cifs-bld-tmp/fs/cifs <%name-shared.patch
tar xfj %SOURCE1
patch -s -p1 -d cifs-bld-tmp/fs/cifs <%name-shared.patch
%install
#export KBUILD_VERBOSE=1
......@@ -102,5 +108,13 @@ MAN_DIR=%buildroot%_mandir/ INIT_DIR=%buildroot%_initdir/ SBIN_DIR=%buildroot%_s
/usr/src/%name/
%changelog
* Thu Jun 14 2007 Vitaly Lipatov <lav@altlinux.ru> 1.48a-alt3
- WINE@Etersoft 1.0.7 beta
- fix inode revalidate for read requests
- fix build module scripts
* Tue Jun 12 2007 Vitaly Lipatov <lav@altlinux.ru> 1.48a-alt2
- WINE@Etersoft 1.0.7 alpha
* Fri Jun 08 2007 Vitaly Lipatov <lav@altlinux.ru> 1.48a-alt1
- initial build for WINE@Etersoft project
......@@ -3,9 +3,10 @@
/linux-cifs.outformat/1.1/Sat Jun 9 19:27:46 2007//
/linux-cifs.release.sh/1.1/Sat Jun 9 18:26:48 2007//
/linux-cifs_depmod.sh/1.1/Fri Mar 16 18:14:13 2007//
/linux-cifs-shared.patch/1.6/Tue Jun 12 17:06:10 2007//
/build.sh/1.10/Tue Jun 12 17:48:52 2007//
/linux-cifs.spec/1.7/Tue Jun 12 17:50:23 2007//
/buildmodule.sh/1.6/Tue Jun 12 17:58:18 2007//
/linux-cifs.init/1.10/Tue Jun 12 18:05:16 2007//
/linux-cifs.spec/1.11/Tue Jun 12 22:09:52 2007//
/linux-cifs-shared.patch/1.16/Thu Jun 14 14:54:53 2007//
/build.sh/1.16/Thu Jun 14 14:55:14 2007//
/buildmodule.sh/1.8/Thu Jun 14 14:54:48 2007//
/TODO/1.2/Thu Jun 14 14:55:23 2007//
/linux-cifs.init/1.14/Thu Jun 14 16:23:52 2007//
D
+ KERNSRC,
?
......@@ -5,8 +5,9 @@
# Build kernel modules for all kernel and all platforms
. functions.sh
. ./functions.sh
echo "All kernel build script. (c) 2007 Etersoft. $Id: build.sh,v 1.16 2007/06/14 14:55:14 lav Exp $"
PACKNAME=linux-cifs
get_src_dir || fatal "Distro $($DISTR_VENDOR -e) is not supported yet"
......@@ -14,6 +15,7 @@ get_src_dir || fatal "Distro $($DISTR_VENDOR -e) is not supported yet"
BUILDDIR=`pwd`/cifs-bld-tmp/fs/cifs
BUILTLIST=
# SMP build
[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS=`/usr/bin/getconf _NPROCESSORS_ONLN`
[ "$RPM_BUILD_NCPUS" -gt 1 ] && MAKESMP="-j$RPM_BUILD_NCPUS" || MAKESMP=""
......@@ -39,7 +41,7 @@ detect_kernel()
fi
}
# install sources
echo "Install sources to $SBIN_DIR/../src/linux-cifs/"
install -m755 -d $SBIN_DIR/../src/linux-cifs/
install -m644 $BUILDDIR/* $SBIN_DIR/../src/linux-cifs/ || exit 1
install -m644 buildmodule.sh $SBIN_DIR/../src/linux-cifs/ || exit 1
......@@ -65,7 +67,8 @@ for KERNEL_SOURCE in `echo $BASE_KERNEL_SOURCES_DIR` ; do
KERVER=$(echo $KERNELVERSION | cut -b 1-3)
# Build and check
# Clean, build and check
make $USEGCC -C $KERNEL_SOURCE here=$BUILDDIR SUBDIRS=$BUILDDIR clean
make $USEGCC -C $KERNEL_SOURCE here=$BUILDDIR SUBDIRS=$BUILDDIR modules $MAKESMP
MODULENAME=cifs
#[ "$KERVER" = "2.4" ] && MODULENAME=$(echo $MODULENAME.o) || MODULENAME=$(echo $MODULENAME.?o)
......@@ -74,7 +77,7 @@ for KERNEL_SOURCE in `echo $BASE_KERNEL_SOURCES_DIR` ; do
#echo "$KERNELVERSION $MODULENAME to $INSTALL_MOD_PATH"
strip --strip-debug --discard-all $BUILDDIR/$MODULENAME
mkdir -p $INSTALL_MOD_PATH/$KERNELVERSION/ $INSTALL_MOD_PATH/$PACKNAME/ || fatal "broken path"
mkdir -p $INSTALL_MOD_PATH/$KERNELVERSION/ || fatal "broken path"
cp -fv $BUILDDIR/$MODULENAME $INSTALL_MOD_PATH/$KERNELVERSION/ || fatal "copy error"
# copy last as default
#cp -f $BUILDDIR/$MODULENAME $INSTALL_MOD_PATH/$PACKNAME/
......
......@@ -6,11 +6,10 @@ MODULENAME=cifs.ko
BUILDDIR=/usr/src/linux-cifs
KERNELVERSION=$(uname -r)
# SMP build
[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS=`/usr/bin/getconf _NPROCESSORS_ONLN`
[ "$RPM_BUILD_NCPUS" -gt 1 ] && MAKESMP="-j$RPM_BUILD_NCPUS" || MAKESMP=""
echo
echo "Build for $KERNELVERSION Linux kernel"
# source and destination directories can be inherited from the environment
if [ -z "$KERNSRC" ]; then
......@@ -18,11 +17,14 @@ if [ -z "$KERNSRC" ]; then
fi
if [ -z "$INSTALL_MOD_PATH" ]; then
#INSTALL_MOD_PATH=/lib/modules/$KERNELVERSION/kernel/extra
INSTALL_MOD_PATH=/lib/modules/linux-cifs/$KERNELVERSION
INSTALL_MOD_PATH=/lib/modules/linux-cifs
fi
echo
echo "Build for $KERNELVERSION Linux kernel (headers in $KERNSRC)"
if [ ! -f $KERNSRC/include/linux/version.h ]; then
cat 1>^2 <<EOF
cat >&2 <<EOF
Error: no kernel headers found at $KERNSRC
Please install package
kernel-headers-modules-XXXX for ALT Linux
......@@ -39,9 +41,10 @@ fi
# set GCC version if needed
test -f $KERNSRC/gcc_version.inc && . $KERNSRC/gcc_version.inc && echo "We in ALT Linux, use GCC $GCC_VERSION" && export USEGCC="CC=gcc-$GCC_VERSION"
rm -f $BUILDDIR/$MODULENAME
# Build and check
# Clean, build and check
rm -f $BUILDDIR/$MODULENAME
make $USEGCC -C $KERNSRC here=$BUILDDIR SUBDIRS=$BUILDDIR clean
make $USEGCC -C $KERNSRC here=$BUILDDIR SUBDIRS=$BUILDDIR modules $MAKESMP
#[ "$KERVER" = "2.4" ] && MODULENAME=$MODULENAME.o || MODULENAME=$MODULENAME.ko
......
......@@ -340,3 +340,97 @@ Fix detecting overlaps completely (use end??)
li->length, li->offset,
1, 0, li->type, FALSE);
Force revalidate for inode
--- cifs/cifsfs.c 2007-06-12 22:05:31 +0400
+++ cifs/cifsfs.c 2007-06-14 18:44:53 +0400
@@ -590,6 +590,19 @@
return written;
}
+static ssize_t cifs_file_read(struct file *file, char *user, size_t cnt, loff_t *pos)
+{
+ if( file!=NULL && file->f_dentry!=NULL && CIFS_I(file->f_dentry->d_inode)!=NULL ) {
+ int retval = 0;
+ CIFS_I(file->f_dentry->d_inode)->needForceInvalidate = 1;
+ retval = cifs_revalidate(file->f_dentry);
+ if( retval < 0 )
+ return (ssize_t)retval;
+ }
+
+ return do_sync_read(file,user,cnt,pos);
+}
+
static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
{
/* origin == SEEK_END => we must revalidate the cached file length */
@@ -679,7 +692,7 @@
};
const struct file_operations cifs_file_ops = {
- .read = do_sync_read,
+ .read = cifs_file_read,
.write = do_sync_write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
.readv = generic_file_readv,
--- cifs/inode.c 2007-06-12 22:05:31 +0400
+++ cifs/inode.c 2007-06-14 16:03:51 +0400
@@ -1027,7 +1027,7 @@
direntry->d_inode->i_count.counter, direntry,
direntry->d_time, jiffies));
- if (cifsInode->time == 0) {
+ if (cifsInode->time == 0 || cifsInode->needForceInvalidate ) {
/* was set to zero previously to force revalidate */
} else if (time_before(jiffies, cifsInode->time + HZ) &&
lookupCacheEnabled) {
@@ -1070,17 +1070,17 @@
had changed on server */
if (timespec_equal(&local_mtime,&direntry->d_inode->i_mtime) &&
- (local_size == direntry->d_inode->i_size)) {
- cFYI(1, ("cifs_revalidate - inode unchanged"));
+ (local_size == direntry->d_inode->i_size) &&
+ !cifsInode->needForceInvalidate ) {
+ cFYI(1, ("***************************** cifs_revalidate - inode unchanged"));
} else {
/* file may have changed on server */
if (cifsInode->clientCanCacheRead) {
/* no need to invalidate inode pages since we were the
only ones who could have modified the file and the
server copy is staler than ours */
- } else {
+ } else
invalidate_inode = TRUE;
- }
}
/* can not grab this sem since kernel filesys locking documentation
@@ -1101,8 +1101,13 @@
if (S_ISREG(direntry->d_inode->i_mode)) {
if (direntry->d_inode->i_mapping)
filemap_fdatawait(direntry->d_inode->i_mapping);
+
+ if( cifsInode->needForceInvalidate ) {
+ cFYI(1, ("Force invalidating."));
+ invalidate_remote_inode(direntry->d_inode);
+ cifsInode->needForceInvalidate = 0;
/* may eventually have to do this for open files too */
- if (list_empty(&(cifsInode->openFileList))) {
+ } else if (list_empty(&(cifsInode->openFileList))) {
/* changed on server - flush read ahead pages */
cFYI(1, ("Invalidating read ahead data on "
"closed file"));
--- cifs/cifsglob.h 2007-06-12 22:05:31 +0400
+++ cifs/cifsglob.h 2007-06-14 16:04:07 +0400
@@ -345,6 +345,7 @@
unsigned clientCanCacheRead:1; /* read oplock */
unsigned clientCanCacheAll:1; /* read and writebehind oplock */
unsigned oplockPending:1;
+ unsigned needForceInvalidate:1;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
struct inode vfs_inode;
#endif
......@@ -11,7 +11,12 @@
#
MODULENAME=cifs
DEFMODULEPATH=`echo /lib/modules/linux-cifs/$(uname -r)/$MODULENAME.ko 2>/dev/null`
# current module or manually built
DEFMODULEPATH=/lib/modules/linux-cifs/$(uname -r)/$MODULENAME.ko
MANMODULEPATH=/lib/modules/linux-cifs/$MODULENAME.ko
[ -r "$DEFMODULEPATH" ] || DEFMODULEPATH=$MANMODULEPATH
OUTFORMAT=/etc/init.d/outformat
[ -x $OUTFORMAT ] || OUTFORMAT=/etc/init.d/linux-cifs.outformat
......@@ -86,13 +91,14 @@ load_module()
rmmod $MODULENAME || { failure ; return ; }
fi
# Preload module dependencies
modprobe nls_base || { echo -n "nls_base is not loaded" ; failure ; }
echo -n "Loading CIFS kernel module... "
if [ -r "$DEFMODULEPATH" ] ; then
insmod $DEFMODULEPATH && { echo -n -e "\n\tvia insmod from $DEFMODULEPATH" ; success ; return ; }
echo -n "Your system: " ; uname -a ; dmesg | tail -n2
else
echo -n " $MODULENAME from Etersoft is not found, you can try compile it with 'service linux-cifs build' command "
insmod $DEFMODULEPATH && { echo -n -e "\n\tinsmod $DEFMODULEPATH" ; success ; return ; }
echo -n "Incorrect module. Your system: " ; uname -a ; dmesg | tail -n2
fi
echo -n "$MODULENAME from Etersoft is not found,\nyou can try compile it with 'service linux-cifs build' command."
failure
}
......@@ -121,21 +127,22 @@ stop()
status()
{
local PRECOMP
echo "CIFS module status:"
if [ "$DEFMODULEPATH" = "$MANMODULEPATH" ] ; then
PRECOMP="manually built"
else
PRECOMP="precompiled"
fi
if is_moduled ; then
echo -e "\tkernel module $MODULENAME is loaded"
echo -e "\tkernel module $MODULENAME is loaded ($PRECOMP)"
echo -n "Etersoft extensions for CIFS enabled..."
test `cat /proc/fs/cifs/Etersoft` = "1" && success || failure
echo -n "Linux extensions for CIFS disabled..."
test `cat /proc/fs/cifs/LinuxExtensionsEnabled` = "1" && failure || success
else
echo -e "\tkernel module $MODULENAME is not loaded"
echo -e "\tkernel module $MODULENAME is not loaded ($PRECOMP)"
fi
if diff $DEFMODULEPATH /usr/src/linux-cifs/cifs.ko 2>/dev/null >/dev/null ; then
echo "Module built manually"
else
echo "Precompiled module"
fi
}
restart()
......@@ -162,6 +169,8 @@ case "$1" in
status
;;
condrestart)
# remove manual built module
rm -f $MANMODULEPATH
if [ "`cat /proc/fs/cifs/Etersoft 2>/dev/null`" = "1" ] ; then
restart
else
......
# Etersoft (c) 2007
# Multiplatform spec for autobuild system
# in kernel build dir you can have gcc_version.inc file with export GCC_VERSION=x.xx
# For build install,
......@@ -12,7 +13,7 @@
Name: linux-cifs
Version: 1.48a
%define relnum 1
%define relnum 2
Summary: Advanced Common Internet File System for Linux with Etersoft extension
......@@ -30,12 +31,19 @@ Source1: http://pserver.samba.org/samba/ftp/cifs-cvs/cifs-%version.tar.bz2
Release: alt%relnum
BuildRequires: rpm-build-compat >= 0.7
BuildRequires: kernel-build-tools
BuildRequires: kernel-headers-modules-std-smp kernel-headers-modules-wks-smp kernel-headers-modules-ovz-smp
%ifarch x86_64
# Don't know if ifnarch exist
BuildRequires: kernel-headers-modules-std-smp
%else
BuildRequires: kernel-headers-modules-std-pae
%endif
%else
Release: eter%relnum%_vendor
BuildRequires: rpm-build-altlinux-compat >= 0.7
%endif
# ifndef broken in Ubuntu
# FIXME: ifndef broken in Ubuntu
#ifndef buildroot
%if %{undefined buildroot}
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
......@@ -54,27 +62,30 @@ ExclusiveOS: Linux
%description
The CIFS VFS is a virtual file system for Linux to allow access to
servers and storage appliances compliant with the SNIA CIFS Specification
version 1.0 or later. Popular servers such as Samba, Windows 2000,
Windows XP and many others support CIFS by default. The CIFS VFS
provides some support for older servers based on the more primitive SMB
(Server Message Block) protocol (you also can use the Linux file system
smbfs as an alternative for accessing these). CIFS VFS is designed to
take advantage of advanced network file system features such as locking,
Unicode (advanced internationalization), hardlinks, dfs (hierarchical,
replicated name space), distributed caching and uses native TCP names
(rather than RFC1001, Netbios names). Unlike some other network
file systems all key network function including authentication is
provided in kernel (and changes to mount and/or a mount helper file
are not required in order to enable the CIFS VFS). With the addition
of upcoming improvements to the mount helper (mount.cifs) the CIFS VFS
will be able to take advantage of the new CIFS URL specification though.
This package has Etersoft's patches for sharing access support.
version 1.0 or later.
Popular servers such as Samba, Windows 2000, Windows XP and many others
support CIFS by default.
The CIFS VFS provides some support for older servers based on the more
primitive SMB (Server Message Block) protocol (you also can use the Linux
file system smbfs as an alternative for accessing these).
CIFS VFS is designed to take advantage of advanced network file system
features such as locking, Unicode (advanced internationalization),
hardlinks, dfs (hierarchical, replicated name space), distributed caching
and uses native TCP names (rather than RFC1001, Netbios names).
Unlike some other network file systems all key network function including
authentication is provided in kernel (and changes to mount and/or a mount
helper file are not required in order to enable the CIFS VFS). With the
addition of upcoming improvements to the mount helper (mount.cifs) the
CIFS VFS will be able to take advantage of the new CIFS URL specification
though.
This package has Etersoft's patches for WINE@Etersoft sharing access support.
%prep
%setup -q
tar xvfj %SOURCE1
patch -p1 -d cifs-bld-tmp/fs/cifs <%name-shared.patch
tar xfj %SOURCE1
patch -s -p1 -d cifs-bld-tmp/fs/cifs <%name-shared.patch
%install
#export KBUILD_VERBOSE=1
......@@ -97,5 +108,8 @@ MAN_DIR=%buildroot%_mandir/ INIT_DIR=%buildroot%_initdir/ SBIN_DIR=%buildroot%_s
/usr/src/%name/
%changelog
* Tue Jun 12 2007 Vitaly Lipatov <lav@altlinux.ru> 1.48a-alt2
- WINE@Etersoft 1.0.7 alpha
* Fri Jun 08 2007 Vitaly Lipatov <lav@altlinux.ru> 1.48a-alt1
- initial build for WINE@Etersoft project
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