Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 252ec9e2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6

parents d4892279 1e6b39fb
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,8 @@ Version 1.39
Defer close of a file handle slightly if pending writes depend on that file handle
Defer close of a file handle slightly if pending writes depend on that file handle
(this reduces the EBADF bad file handle errors that can be logged under heavy
(this reduces the EBADF bad file handle errors that can be logged under heavy
stress on writes). Modify cifs Kconfig options to expose CONFIG_CIFS_STATS2 
stress on writes). Modify cifs Kconfig options to expose CONFIG_CIFS_STATS2 
Fix SFU style symlinks and mknod needed for servers which do not support the CIFS
Unix Extensions.  Fix setfacl/getfacl on bigendian. 


Version 1.38
Version 1.38
------------
------------
+7 −6
Original line number Original line Diff line number Diff line
/*
/*
 *   fs/cifs/cifs_unicode.c
 *   fs/cifs/cifs_unicode.c
 *
 *
 *   Copyright (c) International Business Machines  Corp., 2000,2002
 *   Copyright (c) International Business Machines  Corp., 2000,2005
 *   Modified by Steve French (sfrench@us.ibm.com)
 *   Modified by Steve French (sfrench@us.ibm.com)
 *
 *
 *   This program is free software;  you can redistribute it and/or modify
 *   This program is free software;  you can redistribute it and/or modify
@@ -31,7 +31,7 @@
 *
 *
 */
 */
int
int
cifs_strfromUCS_le(char *to, const wchar_t * from,	/* LITTLE ENDIAN */
cifs_strfromUCS_le(char *to, const __le16 * from,	
		   int len, const struct nls_table *codepage)
		   int len, const struct nls_table *codepage)
{
{
	int i;
	int i;
@@ -60,25 +60,26 @@ cifs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
 *
 *
 */
 */
int
int
cifs_strtoUCS(wchar_t * to, const char *from, int len,
cifs_strtoUCS(__le16 * to, const char *from, int len,
	      const struct nls_table *codepage)
	      const struct nls_table *codepage)
{
{
	int charlen;
	int charlen;
	int i;
	int i;
	wchar_t * wchar_to = (wchar_t *)to; /* needed to quiet sparse */  


	for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
	for (i = 0; len && *from; i++, from += charlen, len -= charlen) {


		/* works for 2.4.0 kernel or later */
		/* works for 2.4.0 kernel or later */
		charlen = codepage->char2uni(from, len, &to[i]);
		charlen = codepage->char2uni(from, len, &wchar_to[i]);
		if (charlen < 1) {
		if (charlen < 1) {
			cERROR(1,
			cERROR(1,
			       ("cifs_strtoUCS: char2uni returned %d",
			       ("cifs_strtoUCS: char2uni returned %d",
				charlen));
				charlen));
			/* A question mark */
			/* A question mark */
			to[i] = (wchar_t)cpu_to_le16(0x003f);
			to[i] = cpu_to_le16(0x003f);
			charlen = 1;
			charlen = 1;
		} else 
		} else 
			to[i] = (wchar_t)cpu_to_le16(to[i]);
			to[i] = cpu_to_le16(wchar_to[i]);


	}
	}


+3 −3
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
 *     Convert a unicode character to upper or lower case using
 *     Convert a unicode character to upper or lower case using
 *     compressed tables.
 *     compressed tables.
 *
 *
 *   Copyright (c) International Business Machines  Corp., 2000,2002
 *   Copyright (c) International Business Machines  Corp., 2000,2005555555555555555555555555555555555555555555555555555555
 *
 *
 *   This program is free software;  you can redistribute it and/or modify
 *   This program is free software;  you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   it under the terms of the GNU General Public License as published by
@@ -59,8 +59,8 @@ extern struct UniCaseRange UniLowerRange[];
#endif				/* UNIUPR_NOLOWER */
#endif				/* UNIUPR_NOLOWER */


#ifdef __KERNEL__
#ifdef __KERNEL__
int cifs_strfromUCS_le(char *, const wchar_t *, int, const struct nls_table *);
int cifs_strfromUCS_le(char *, const __le16 *, int, const struct nls_table *);
int cifs_strtoUCS(wchar_t *, const char *, int, const struct nls_table *);
int cifs_strtoUCS(__le16 *, const char *, int, const struct nls_table *);
#endif
#endif


/*
/*
+1 −1
Original line number Original line Diff line number Diff line
@@ -149,7 +149,7 @@ int CalcNTLMv2_partial_mac_key(struct cifsSesInfo * ses, struct nls_table * nls_
	char temp_hash[16];
	char temp_hash[16];
	struct HMACMD5Context ctx;
	struct HMACMD5Context ctx;
	char * ucase_buf;
	char * ucase_buf;
	wchar_t * unicode_buf;
	__le16 * unicode_buf;
	unsigned int i,user_name_len,dom_name_len;
	unsigned int i,user_name_len,dom_name_len;


	if(ses == NULL)
	if(ses == NULL)
+60 −47
Original line number Original line Diff line number Diff line
@@ -483,57 +483,30 @@ cifs_get_sb(struct file_system_type *fs_type,
	return sb;
	return sb;
}
}


static ssize_t
static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov,
cifs_read_wrapper(struct file * file, char __user *read_data, size_t read_size,
				unsigned long nr_segs, loff_t *ppos)
          loff_t * poffset)
{
{
	if(file->f_dentry == NULL)
	struct inode *inode = file->f_dentry->d_inode;
		return -EIO;
	ssize_t written;
	else if(file->f_dentry->d_inode == NULL)
		return -EIO;

	cFYI(1,("In read_wrapper size %zd at %lld",read_size,*poffset));

	if(CIFS_I(file->f_dentry->d_inode)->clientCanCacheRead) {
		return generic_file_read(file,read_data,read_size,poffset);
	} else {
		/* BB do we need to lock inode from here until after invalidate? */
/*		if(file->f_dentry->d_inode->i_mapping) {
			filemap_fdatawrite(file->f_dentry->d_inode->i_mapping);
			filemap_fdatawait(file->f_dentry->d_inode->i_mapping);
		}*/
/*		cifs_revalidate(file->f_dentry);*/ /* BB fixme */


		/* BB we should make timer configurable - perhaps 
	written = generic_file_writev(file, iov, nr_segs, ppos);
		   by simply calling cifs_revalidate here */
	if (!CIFS_I(inode)->clientCanCacheAll)
		/* invalidate_remote_inode(file->f_dentry->d_inode);*/
		filemap_fdatawrite(inode->i_mapping);
		return generic_file_read(file,read_data,read_size,poffset);
	return written;
	}
}
}


static ssize_t
static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf,
cifs_write_wrapper(struct file * file, const char __user *write_data,
				   size_t count, loff_t pos)
           size_t write_size, loff_t * poffset) 
{
{
	struct inode *inode = iocb->ki_filp->f_dentry->d_inode;
	ssize_t written;
	ssize_t written;


	if(file->f_dentry == NULL)
	written = generic_file_aio_write(iocb, buf, count, pos);
		return -EIO;
	if (!CIFS_I(inode)->clientCanCacheAll)
	else if(file->f_dentry->d_inode == NULL)
		filemap_fdatawrite(inode->i_mapping);
		return -EIO;

	cFYI(1,("In write_wrapper size %zd at %lld",write_size,*poffset));

	written = generic_file_write(file,write_data,write_size,poffset);
	if(!CIFS_I(file->f_dentry->d_inode)->clientCanCacheAll)  {
		if(file->f_dentry->d_inode->i_mapping) {
			filemap_fdatawrite(file->f_dentry->d_inode->i_mapping);
		}
	}
	return written;
	return written;
}
}



static struct file_system_type cifs_fs_type = {
static struct file_system_type cifs_fs_type = {
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.name = "cifs",
	.name = "cifs",
@@ -594,8 +567,12 @@ struct inode_operations cifs_symlink_inode_ops = {
};
};


struct file_operations cifs_file_ops = {
struct file_operations cifs_file_ops = {
	.read = cifs_read_wrapper,
	.read = do_sync_read,
	.write = cifs_write_wrapper, 
	.write = do_sync_write,
	.readv = generic_file_readv,
	.writev = cifs_file_writev,
	.aio_read = generic_file_aio_read,
	.aio_write = cifs_file_aio_write,
	.open = cifs_open,
	.open = cifs_open,
	.release = cifs_close,
	.release = cifs_close,
	.lock = cifs_lock,
	.lock = cifs_lock,
@@ -608,10 +585,6 @@ struct file_operations cifs_file_ops = {
#endif /* CONFIG_CIFS_POSIX */
#endif /* CONFIG_CIFS_POSIX */


#ifdef CONFIG_CIFS_EXPERIMENTAL
#ifdef CONFIG_CIFS_EXPERIMENTAL
	.readv = generic_file_readv,
	.writev = generic_file_writev,
	.aio_read = generic_file_aio_read,
	.aio_write = generic_file_aio_write,
	.dir_notify = cifs_dir_notify,
	.dir_notify = cifs_dir_notify,
#endif /* CONFIG_CIFS_EXPERIMENTAL */
#endif /* CONFIG_CIFS_EXPERIMENTAL */
};
};
@@ -631,6 +604,46 @@ struct file_operations cifs_file_direct_ops = {
	.ioctl  = cifs_ioctl,
	.ioctl  = cifs_ioctl,
#endif /* CONFIG_CIFS_POSIX */
#endif /* CONFIG_CIFS_POSIX */


#ifdef CONFIG_CIFS_EXPERIMENTAL
	.dir_notify = cifs_dir_notify,
#endif /* CONFIG_CIFS_EXPERIMENTAL */
};
struct file_operations cifs_file_nobrl_ops = {
	.read = do_sync_read,
	.write = do_sync_write,
	.readv = generic_file_readv,
	.writev = cifs_file_writev,
	.aio_read = generic_file_aio_read,
	.aio_write = cifs_file_aio_write,
	.open = cifs_open,
	.release = cifs_close,
	.fsync = cifs_fsync,
	.flush = cifs_flush,
	.mmap  = cifs_file_mmap,
	.sendfile = generic_file_sendfile,
#ifdef CONFIG_CIFS_POSIX
	.ioctl	= cifs_ioctl,
#endif /* CONFIG_CIFS_POSIX */

#ifdef CONFIG_CIFS_EXPERIMENTAL
	.dir_notify = cifs_dir_notify,
#endif /* CONFIG_CIFS_EXPERIMENTAL */
};

struct file_operations cifs_file_direct_nobrl_ops = {
	/* no mmap, no aio, no readv - 
	   BB reevaluate whether they can be done with directio, no cache */
	.read = cifs_user_read,
	.write = cifs_user_write,
	.open = cifs_open,
	.release = cifs_close,
	.fsync = cifs_fsync,
	.flush = cifs_flush,
	.sendfile = generic_file_sendfile, /* BB removeme BB */
#ifdef CONFIG_CIFS_POSIX
	.ioctl  = cifs_ioctl,
#endif /* CONFIG_CIFS_POSIX */

#ifdef CONFIG_CIFS_EXPERIMENTAL
#ifdef CONFIG_CIFS_EXPERIMENTAL
	.dir_notify = cifs_dir_notify,
	.dir_notify = cifs_dir_notify,
#endif /* CONFIG_CIFS_EXPERIMENTAL */
#endif /* CONFIG_CIFS_EXPERIMENTAL */
Loading