summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] vfs: add lock owner argument to flush operationMiklos Szeredi2006-06-231-1/+1
| | | | | | | | | | | | | | | | | | | Pass the POSIX lock owner ID to the flush operation. This is useful for filesystems which don't want to store any locking state in inode->i_flock but want to handle locking/unlocking POSIX locks internally. FUSE is one such filesystem but I think it possible that some network filesystems would need this also. Also add a flag to indicate that a POSIX locking request was generated by close(), so filesystems using the above feature won't send an extra locking request in this case. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] writeback: fix range handlingOGAWA Hirofumi2006-06-231-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a writeback_control's `start' and `end' fields are used to indicate a one-byte-range starting at file offset zero, the required values of .start=0,.end=0 mean that the ->writepages() implementation has no way of telling that it is being asked to perform a range request. Because we're currently overloading (start == 0 && end == 0) to mean "this is not a write-a-range request". To make all this sane, the patch changes range of writeback_control. So caller does: If it is calling ->writepages() to write pages, it sets range (range_start/end or range_cyclic) always. And if range_cyclic is true, ->writepages() thinks the range is cyclic, otherwise it just uses range_start and range_end. This patch does, - Add LLONG_MAX, LLONG_MIN, ULLONG_MAX to include/linux/kernel.h -1 is usually ok for range_end (type is long long). But, if someone did, range_end += val; range_end is "val - 1" u64val = range_end >> bits; u64val is "~(0ULL)" or something, they are wrong. So, this adds LLONG_MAX to avoid nasty things, and uses LLONG_MAX for range_end. - All callers of ->writepages() sets range_start/end or range_cyclic. - Fix updates of ->writeback_index. It seems already bit strange. If it starts at 0 and ended by check of nr_to_write, this last index may reduce chance to scan end of file. So, this updates ->writeback_index only if range_cyclic is true or whole-file is scanned. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Nathan Scott <nathans@sgi.com> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Steven French <sfrench@us.ibm.com> Cc: "Vladimir V. Saveliev" <vs@namesys.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [[CIFS] Pass truncate open flag through on file open in case setattr failsSteve French2006-05-301-0/+2
| | | | | | | on set size to zero. Signed-off-by: Sebastian Voitzsch <sebastoam/vpotzscj@web.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix typos in previous fixSteve French2006-05-301-2/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] ACPI suspend oopsSteve French2006-05-301-2/+4
| | | | | | | | | | | | | Wasn't able to reproduce a hard hang, but was able to get an oops if suspended the machine during a copy to the cifs mount. This led to some things hanging, including a "sync". Also got I/O errors when trying to access the mount afterwards (even when didn't see the oops), and had to unmount and remount in order to access the filesystem. This patch fixed the oops. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix new POSIX Locking for setting lock_type correctly on unlockSteve French2006-05-301-2/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Readdir fixes to allow search to start at arbitrary positionSteve French2006-04-221-12/+20
| | | | | | | | | in directory Also includes first part of fix to compensate for servers which forget to return . and .. as well as updates to changelog and cifs readme. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] [CIFS] Do not take rename sem on most path based calls (duringSteve French2006-04-211-2/+0
| | | | | | | | building of full path) to avoid hang rename/readdir hang Reported by Alan Tyson Signed-off-by: Steve French <sfrench@us.ibm.com>
* Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.gitSteve French2006-03-311-4/+6
|\ | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * [PATCH] Make address_space_operations->sync_page return voidNeilBrown2006-03-261-2/+4
| | | | | | | | | | | | | | | | | | The only user ignores the return value, and the only instanace (block_sync_page) always returns 0... Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| * [PATCH] sem2mutex: vfs_rename_mutexArjan van de Ven2006-03-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Al Viro <viro@ftp.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [CIFS] Set correct lock type on new posix unlock callSteve French2006-03-031-1/+1
| | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Make POSIX CIFS Extensions SetFSInfo match exactly what we wantSteve French2006-03-021-2/+6
| | | | | | | | | | | | not just the posix path feature. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Add posix (advisory) byte range locking support to cifs clientSteve French2006-02-281-19/+48
| | | | | | | | | | | | | | | | Samba (version 3) server support for this is also currently being done. This client code is in an experimental path (requires enabling /proc/fs/cifs/Experimental) while it is being tested. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] CIFS readdir perf optimizations part 1Steve French2006-02-281-9/+14
|/ | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [PATCH] CIFS: fix cifs_user_read oops when null SMB response on ↵Steve French2006-02-141-6/+8
| | | | | | | | | | | forcedirectio mount This patch fixes an oops reported by Adrian Bunk in cifs_user_read when a null read response is returned on a forcedirectio mount. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Signed-off-by: Steve French <sfrench@us.ibm.com>Steve French2006-01-271-1/+7
|
* [CIFS] Fix oops in cifs_readpages caused by not checking buf_type in anSteve French2006-01-181-1/+4
| | | | | | error path of new cifs_readpages code. Signed-off-by: Steve French <sfrench@us.ibm.com>
* Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.gitSteve French2006-01-121-4/+2
|\ | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait)OGAWA Hirofumi2006-01-081-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add EXPORT_SYMBOL(filemap_write_and_wait) and use it. See mm/filemap.c: And changes the filemap_write_and_wait() and filemap_write_and_wait_range(). Current filemap_write_and_wait() doesn't wait if filemap_fdatawrite() returns error. However, even if filemap_fdatawrite() returned an error, it may have submitted the partially data pages to the device. (e.g. in the case of -ENOSPC) <quotation> Andrew Morton writes, If filemap_fdatawrite() returns an error, this might be due to some I/O problem: dead disk, unplugged cable, etc. Given the generally crappy quality of the kernel's handling of such exceptions, there's a good chance that the filemap_fdatawait() will get stuck in D state forever. </quotation> So, this patch doesn't wait if filemap_fdatawrite() returns the -EIO. Trond, could you please review the nfs part? Especially I'm not sure, nfs must use the "filemap_fdatawrite(inode->i_mapping) == 0", or not. Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [CIFS] Allow local filesize for file that is open for write to be updatedSteve French2006-01-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | from server when mount forcedirectio. Allowing update of file size with non forcedirectio mounts should be allowed in the fiture but requires carefully writing out the last page in the local file if it is a partial page in order to avoid corruption and careful serialization Thanks to Maximiliano Curia who suggested similar changes and provided a testcase. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Avoid extra large buffer allocation (and memcpy) in cifs_readpagesSteve French2005-12-121-20/+32
| | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Readpages and readir performance improvements - eliminate extraSteve French2005-12-021-6/+0
|/ | | | | | memcpy. Part 1 Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Missing part of previous patchSteve French2005-11-181-0/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Defer close of file handle slightly if there are pending writes thatSteve French2005-10-201-24/+64
| | | | | | | | need to get in ahead of it that depend on that file handle. Fixes occassional bad file handle errors on write with heavy use multiple process cases. Signed-off-by: Steve French <sfrench@us.ibm.com>
* CIFS: cifs_writepages should not write beyond end of fileSteve French2005-10-121-2/+13
| | | | | Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] CIFS Stats improvementsSteve French2005-10-111-0/+3
| | | | | | New cifs_writepages routine was not updated bytes written in cifs stats. Also added ability to clear /proc/fs/cifs/Stats by writing (0 or 1) to it. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix rsize calculation so that large readx flag is checked.Steve French2005-10-101-2/+3
| | | | Signed-off-by: Steve French (sfrench@us.ibm.com)
* [CIFS] cleanup sparse and compile errors in previous fixSteve French2005-10-051-2/+3
| | | | Signed-off-by: Steve French (sfrench@us.ibm.com)
* CIFS: Allow wsize to exceed CIFSMaxBufSizeSteve French2005-10-051-0/+8
| | | | | | | | This allows cifs_writepages to send data in larger chunks from the page cache, without requiring larger memory allocations in other cases. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* CIFS: implement cifs_writepages to perform multi-page I/OSteve French2005-10-051-7/+184
| | | | | Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* CIFS: Create routine find_writable_file to reduce redundant codeSteve French2005-10-051-77/+35
| | | | | Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Add writepages support to shrink memory usage on writes,Steve French2005-10-031-5/+11
| | | | | | | | | | eliminate the double copy, and improve cifs write performance and help the server by upping the typical write size from 4K to 16K (or even larger if wsize set explicitly) for servers which support this. Part 1 of 2 Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Add support for legacy servers part six. Fix read syntax soSteve French2005-09-151-0/+7
| | | | | | | we do not request more than negotiated buffer size even if buffer size is small (smaller than one page) Signed-off-by: Steve French (sfrench@us.ibm.com)
* [CIFS] Fix compiler warningsSteve French2005-09-151-2/+2
| | | | | | Fix some compiler warnings noticed on x64 by me and ppc64 by Shaggy Signed-off-by: Steve French (sfrench@us.ibm.com)
* [CIFS] Add support for legacy servers part 5Steve French2005-08-311-54/+4
| | | | | | | Handle small negotiated read sizes (under 4K) and finish up read and write support. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Add support for legacy servers part 4Steve French2005-08-301-18/+48
| | | | | | | Fix WriteX support for old servers which do not support large files. Signed-off-by: Steve French <sfrench@us.ibm.com>
* Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.gitSteve French2005-08-301-1/+1
|\
| * [PATCH] Fix oops in fs/locks.c on close of file with pending locksSteve French2005-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent change to locks_remove_flock code in fs/locks.c changes how byte range locks are removed from closing files, which shows up a bug in cifs. The assumption in the cifs code was that the close call sent to the server would remove any pending locks on the server on this file, but that is no longer safe as the fs/locks.c code on the client wants unlock of 0 to PATH_MAX to remove all locks (at least from this client, it is not possible AFAIK to remove all locks from other clients made to the server copy of the file). Note that cifs locks are different from posix locks - and it is not possible to map posix locks perfectly on the wire yet, due to restrictions of the cifs network protocol, even to Samba without adding a new request type to the network protocol (which we plan to do for Samba 3.0.21 within a few months), but the local client will have the correct, posix view, of the lock in most cases. The correct fix for cifs for this would involve a bigger change than I would like to do this late in the 2.6.13-rc cycle - and would involve cifs keeping track of all unmerged (uncoalesced) byte range locks for each remote inode and scanning that list to remove locks that intersect or fall wholly within the range - locks that intersect may have to be reaquired with the smaller, remaining range. Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [CIFS] Remove cifs_sb argument from *build_path_from_dentrySteve French2005-08-301-2/+2
| | | | | | | | | | | | | | | | This argument was added in a recent patch, but is unnecessary, since the superblock is easily obtained from the dentry. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Support for legacy servers part 3 - Add support for Open and mostSteve French2005-08-241-2/+27
| | | | | | | | | | | | of Read support. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | CIFS: Reduce CONFIG_CIFS_STATS ifdefsSteve French2005-08-241-29/+5
| | | | | | | | | | | | | | | | Make cifs_stats code conditional in the header files to avoid ifdefs in the main code. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Make CIFS statistics more accurate and add some stats that wereSteve French2005-08-201-5/+0
| | | | | | | | | | | | missing. Most importantly SMB reads were undercounted. Signed-off-by: Steve French (sfrench@us.ibm.com)
* | [CIFS] Performance improvement, finish up adding CIFSSMBWrite2Steve French2005-06-231-4/+3
| | | | | | | | Signed-off-by: Steve French (sfrench@us.ibm.com)
* | Merge with ↵Steve French2005-06-221-2/+2
|\ \ | | | | | | | | | rsync://rsync.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
| * | [CIFS] POSIX extensions, SetFSInfo addedJeremy Allison2005-06-221-2/+2
| |/ | | | | | | | | Signed-off-by: Steve French@sfrench@us.ibm.com Signed-off-by: Jeremy Allison (jra@samba.org)
* | Merge with ↵Steve French2005-06-131-0/+2
|\ \ | |/ | | | | rsync://rsync.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
| * [CIFS] Fix cifs update of page cache. Write at correct offset when out of memorySteve French2005-06-091-0/+2
| | | | | | | | | | | | | | | | | | | | and add_to_page_cache fails. Thanks to Shaggy for pointing out the fix. Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Shaggy (shaggy@us.ibm.com)
* | [CIFS] CIFS writepage improvements - eliminate double copySteve French2005-06-131-4/+17
|/ | | | Signed-off-by: Steve French (sfrench@us.ibm.com)
* [PATCH] cifs: Do not init smb requests or block when sending requestsSteve French2005-04-281-1/+2
| | | | | | | | | | if cifsd thread is no longer running to demultixplex responses. Do not send FindClose request when FindFirst failed without reaching end of search. Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
OpenPOWER on IntegriCloud