Loading fs/cifs/CHANGES +2 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ Version 1.39 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 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 ------------ Loading fs/cifs/cifs_unicode.c +7 −6 Original line number Diff line number Diff line /* * 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) * * This program is free software; you can redistribute it and/or modify Loading Loading @@ -31,7 +31,7 @@ * */ 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 i; Loading Loading @@ -60,25 +60,26 @@ cifs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ * */ 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) { int charlen; int i; wchar_t * wchar_to = (wchar_t *)to; /* needed to quiet sparse */ for (i = 0; len && *from; i++, from += charlen, len -= charlen) { /* 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) { cERROR(1, ("cifs_strtoUCS: char2uni returned %d", charlen)); /* A question mark */ to[i] = (wchar_t)cpu_to_le16(0x003f); to[i] = cpu_to_le16(0x003f); charlen = 1; } else to[i] = (wchar_t)cpu_to_le16(to[i]); to[i] = cpu_to_le16(wchar_to[i]); } Loading fs/cifs/cifs_unicode.h +3 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * Convert a unicode character to upper or lower case using * 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 * it under the terms of the GNU General Public License as published by Loading Loading @@ -59,8 +59,8 @@ extern struct UniCaseRange UniLowerRange[]; #endif /* UNIUPR_NOLOWER */ #ifdef __KERNEL__ int cifs_strfromUCS_le(char *, const wchar_t *, int, const struct nls_table *); int cifs_strtoUCS(wchar_t *, const char *, int, const struct nls_table *); int cifs_strfromUCS_le(char *, const __le16 *, int, const struct nls_table *); int cifs_strtoUCS(__le16 *, const char *, int, const struct nls_table *); #endif /* Loading fs/cifs/cifsencrypt.c +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ int CalcNTLMv2_partial_mac_key(struct cifsSesInfo * ses, struct nls_table * nls_ char temp_hash[16]; struct HMACMD5Context ctx; char * ucase_buf; wchar_t * unicode_buf; __le16 * unicode_buf; unsigned int i,user_name_len,dom_name_len; if(ses == NULL) Loading fs/cifs/cifsfs.c +60 −47 Original line number Diff line number Diff line Loading @@ -483,57 +483,30 @@ cifs_get_sb(struct file_system_type *fs_type, return sb; } static ssize_t cifs_read_wrapper(struct file * file, char __user *read_data, size_t read_size, loff_t * poffset) static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos) { if(file->f_dentry == NULL) return -EIO; 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 */ struct inode *inode = file->f_dentry->d_inode; ssize_t written; /* BB we should make timer configurable - perhaps by simply calling cifs_revalidate here */ /* invalidate_remote_inode(file->f_dentry->d_inode);*/ return generic_file_read(file,read_data,read_size,poffset); } written = generic_file_writev(file, iov, nr_segs, ppos); if (!CIFS_I(inode)->clientCanCacheAll) filemap_fdatawrite(inode->i_mapping); return written; } static ssize_t cifs_write_wrapper(struct file * file, const char __user *write_data, size_t write_size, loff_t * poffset) static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos) { struct inode *inode = iocb->ki_filp->f_dentry->d_inode; ssize_t written; if(file->f_dentry == NULL) return -EIO; else if(file->f_dentry->d_inode == NULL) 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); } } written = generic_file_aio_write(iocb, buf, count, pos); if (!CIFS_I(inode)->clientCanCacheAll) filemap_fdatawrite(inode->i_mapping); return written; } static struct file_system_type cifs_fs_type = { .owner = THIS_MODULE, .name = "cifs", Loading Loading @@ -594,8 +567,12 @@ struct inode_operations cifs_symlink_inode_ops = { }; struct file_operations cifs_file_ops = { .read = cifs_read_wrapper, .write = cifs_write_wrapper, .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, .lock = cifs_lock, Loading @@ -608,10 +585,6 @@ struct file_operations cifs_file_ops = { #endif /* CONFIG_CIFS_POSIX */ #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, #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; Loading @@ -631,6 +604,46 @@ struct file_operations cifs_file_direct_ops = { .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_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 .dir_notify = cifs_dir_notify, #endif /* CONFIG_CIFS_EXPERIMENTAL */ Loading Loading
fs/cifs/CHANGES +2 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ Version 1.39 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 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 ------------ Loading
fs/cifs/cifs_unicode.c +7 −6 Original line number Diff line number Diff line /* * 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) * * This program is free software; you can redistribute it and/or modify Loading Loading @@ -31,7 +31,7 @@ * */ 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 i; Loading Loading @@ -60,25 +60,26 @@ cifs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ * */ 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) { int charlen; int i; wchar_t * wchar_to = (wchar_t *)to; /* needed to quiet sparse */ for (i = 0; len && *from; i++, from += charlen, len -= charlen) { /* 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) { cERROR(1, ("cifs_strtoUCS: char2uni returned %d", charlen)); /* A question mark */ to[i] = (wchar_t)cpu_to_le16(0x003f); to[i] = cpu_to_le16(0x003f); charlen = 1; } else to[i] = (wchar_t)cpu_to_le16(to[i]); to[i] = cpu_to_le16(wchar_to[i]); } Loading
fs/cifs/cifs_unicode.h +3 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * Convert a unicode character to upper or lower case using * 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 * it under the terms of the GNU General Public License as published by Loading Loading @@ -59,8 +59,8 @@ extern struct UniCaseRange UniLowerRange[]; #endif /* UNIUPR_NOLOWER */ #ifdef __KERNEL__ int cifs_strfromUCS_le(char *, const wchar_t *, int, const struct nls_table *); int cifs_strtoUCS(wchar_t *, const char *, int, const struct nls_table *); int cifs_strfromUCS_le(char *, const __le16 *, int, const struct nls_table *); int cifs_strtoUCS(__le16 *, const char *, int, const struct nls_table *); #endif /* Loading
fs/cifs/cifsencrypt.c +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ int CalcNTLMv2_partial_mac_key(struct cifsSesInfo * ses, struct nls_table * nls_ char temp_hash[16]; struct HMACMD5Context ctx; char * ucase_buf; wchar_t * unicode_buf; __le16 * unicode_buf; unsigned int i,user_name_len,dom_name_len; if(ses == NULL) Loading
fs/cifs/cifsfs.c +60 −47 Original line number Diff line number Diff line Loading @@ -483,57 +483,30 @@ cifs_get_sb(struct file_system_type *fs_type, return sb; } static ssize_t cifs_read_wrapper(struct file * file, char __user *read_data, size_t read_size, loff_t * poffset) static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos) { if(file->f_dentry == NULL) return -EIO; 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 */ struct inode *inode = file->f_dentry->d_inode; ssize_t written; /* BB we should make timer configurable - perhaps by simply calling cifs_revalidate here */ /* invalidate_remote_inode(file->f_dentry->d_inode);*/ return generic_file_read(file,read_data,read_size,poffset); } written = generic_file_writev(file, iov, nr_segs, ppos); if (!CIFS_I(inode)->clientCanCacheAll) filemap_fdatawrite(inode->i_mapping); return written; } static ssize_t cifs_write_wrapper(struct file * file, const char __user *write_data, size_t write_size, loff_t * poffset) static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos) { struct inode *inode = iocb->ki_filp->f_dentry->d_inode; ssize_t written; if(file->f_dentry == NULL) return -EIO; else if(file->f_dentry->d_inode == NULL) 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); } } written = generic_file_aio_write(iocb, buf, count, pos); if (!CIFS_I(inode)->clientCanCacheAll) filemap_fdatawrite(inode->i_mapping); return written; } static struct file_system_type cifs_fs_type = { .owner = THIS_MODULE, .name = "cifs", Loading Loading @@ -594,8 +567,12 @@ struct inode_operations cifs_symlink_inode_ops = { }; struct file_operations cifs_file_ops = { .read = cifs_read_wrapper, .write = cifs_write_wrapper, .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, .lock = cifs_lock, Loading @@ -608,10 +585,6 @@ struct file_operations cifs_file_ops = { #endif /* CONFIG_CIFS_POSIX */ #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, #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; Loading @@ -631,6 +604,46 @@ struct file_operations cifs_file_direct_ops = { .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_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 .dir_notify = cifs_dir_notify, #endif /* CONFIG_CIFS_EXPERIMENTAL */ Loading