Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fixes from Steve French:
"Two minor cifs fixes and a minor documentation cleanup for cifs.txt"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
cifs: update cifs.txt and remove some outdated infos
cifs: Avoid calling unlock_page() twice in cifs_readpage() when using fscache
cifs: Do not take a reference to the page in cifs_readpage_worker()

+21 -36
+11 -31
Documentation/filesystems/cifs/cifs.txt
··· 1 This is the client VFS module for the Common Internet File System 2 (CIFS) protocol which is the successor to the Server Message Block 3 (SMB) protocol, the native file sharing mechanism for most early 4 - PC operating systems. CIFS is fully supported by current network 5 - file servers such as Windows 2000, Windows 2003 (including 6 - Windows XP) as well by Samba (which provides excellent CIFS 7 server support for Linux and many other operating systems), so 8 this network filesystem client can mount to a wide variety of 9 - servers. The smbfs module should be used instead of this cifs module 10 - for mounting to older SMB servers such as OS/2. The smbfs and cifs 11 - modules can coexist and do not conflict. The CIFS VFS filesystem 12 - module is designed to work well with servers that implement the 13 - newer versions (dialects) of the SMB/CIFS protocol such as Samba, 14 - the program written by Andrew Tridgell that turns any Unix host 15 - into a SMB/CIFS file server. 16 17 The intent of this module is to provide the most advanced network 18 file system function for CIFS compliant servers, including better ··· 20 alternative to NFSv4 for fileserving in some Linux to Linux environments, 21 not just in Linux to Windows environments. 22 23 - This filesystem has an optional mount utility (mount.cifs) that can 24 - be obtained from the project page and installed in the path in the same 25 - directory with the other mount helpers (such as mount.smbfs). 26 - Mounting using the cifs filesystem without installing the mount helper 27 - requires specifying the server's ip address. 28 29 - For Linux 2.4: 30 - mount //anything/here /mnt_target -o 31 - user=username,pass=password,unc=//ip_address_of_server/sharename 32 33 - For Linux 2.5: 34 - mount //ip_address_of_server/sharename /mnt_target -o user=username, pass=password 35 36 37 - For more information on the module see the project page at 38 - 39 - http://us1.samba.org/samba/Linux_CIFS_client.html 40 - 41 - For more information on CIFS see: 42 - 43 - http://www.snia.org/tech_activities/CIFS 44 - 45 - or the Samba site: 46 - 47 - http://www.samba.org
··· 1 This is the client VFS module for the Common Internet File System 2 (CIFS) protocol which is the successor to the Server Message Block 3 (SMB) protocol, the native file sharing mechanism for most early 4 + PC operating systems. New and improved versions of CIFS are now 5 + called SMB2 and SMB3. These dialects are also supported by the 6 + CIFS VFS module. CIFS is fully supported by network 7 + file servers such as Windows 2000, 2003, 2008 and 2012 8 + as well by Samba (which provides excellent CIFS 9 server support for Linux and many other operating systems), so 10 this network filesystem client can mount to a wide variety of 11 + servers. 12 13 The intent of this module is to provide the most advanced network 14 file system function for CIFS compliant servers, including better ··· 24 alternative to NFSv4 for fileserving in some Linux to Linux environments, 25 not just in Linux to Windows environments. 26 27 + This filesystem has an mount utility (mount.cifs) that can be obtained from 28 29 + https://ftp.samba.org/pub/linux-cifs/cifs-utils/ 30 31 + It must be installed in the directory with the other mount helpers. 32 33 + For more information on the module see the project wiki page at 34 35 + https://wiki.samba.org/index.php/LinuxCIFS_utils
+10 -5
fs/cifs/file.c
··· 3379 return rc; 3380 } 3381 3382 static int cifs_readpage_worker(struct file *file, struct page *page, 3383 loff_t *poffset) 3384 { ··· 3393 if (rc == 0) 3394 goto read_complete; 3395 3396 - page_cache_get(page); 3397 read_data = kmap(page); 3398 /* for reads over a certain size could initiate async read ahead */ 3399 ··· 3419 3420 io_error: 3421 kunmap(page); 3422 - page_cache_release(page); 3423 3424 read_complete: 3425 return rc; ··· 3443 page, (int)offset, (int)offset); 3444 3445 rc = cifs_readpage_worker(file, page, &offset); 3446 - 3447 - unlock_page(page); 3448 3449 free_xid(xid); 3450 return rc; ··· 3497 loff_t pos, unsigned len, unsigned flags, 3498 struct page **pagep, void **fsdata) 3499 { 3500 pgoff_t index = pos >> PAGE_CACHE_SHIFT; 3501 loff_t offset = pos & (PAGE_CACHE_SIZE - 1); 3502 loff_t page_start = pos & PAGE_MASK; ··· 3507 3508 cifs_dbg(FYI, "write_begin from %lld len %d\n", (long long)pos, len); 3509 3510 page = grab_cache_page_write_begin(mapping, index, flags); 3511 if (!page) { 3512 rc = -ENOMEM; ··· 3549 } 3550 } 3551 3552 - if ((file->f_flags & O_ACCMODE) != O_WRONLY) { 3553 /* 3554 * might as well read a page, it is fast enough. If we get 3555 * an error, we don't need to return it. cifs_write_end will 3556 * do a sync write instead since PG_uptodate isn't set. 3557 */ 3558 cifs_readpage_worker(file, page, &page_start); 3559 } else { 3560 /* we could try using another file handle if there is one - 3561 but how would we lock it to prevent close of that handle
··· 3379 return rc; 3380 } 3381 3382 + /* 3383 + * cifs_readpage_worker must be called with the page pinned 3384 + */ 3385 static int cifs_readpage_worker(struct file *file, struct page *page, 3386 loff_t *poffset) 3387 { ··· 3390 if (rc == 0) 3391 goto read_complete; 3392 3393 read_data = kmap(page); 3394 /* for reads over a certain size could initiate async read ahead */ 3395 ··· 3417 3418 io_error: 3419 kunmap(page); 3420 + unlock_page(page); 3421 3422 read_complete: 3423 return rc; ··· 3441 page, (int)offset, (int)offset); 3442 3443 rc = cifs_readpage_worker(file, page, &offset); 3444 3445 free_xid(xid); 3446 return rc; ··· 3497 loff_t pos, unsigned len, unsigned flags, 3498 struct page **pagep, void **fsdata) 3499 { 3500 + int oncethru = 0; 3501 pgoff_t index = pos >> PAGE_CACHE_SHIFT; 3502 loff_t offset = pos & (PAGE_CACHE_SIZE - 1); 3503 loff_t page_start = pos & PAGE_MASK; ··· 3506 3507 cifs_dbg(FYI, "write_begin from %lld len %d\n", (long long)pos, len); 3508 3509 + start: 3510 page = grab_cache_page_write_begin(mapping, index, flags); 3511 if (!page) { 3512 rc = -ENOMEM; ··· 3547 } 3548 } 3549 3550 + if ((file->f_flags & O_ACCMODE) != O_WRONLY && !oncethru) { 3551 /* 3552 * might as well read a page, it is fast enough. If we get 3553 * an error, we don't need to return it. cifs_write_end will 3554 * do a sync write instead since PG_uptodate isn't set. 3555 */ 3556 cifs_readpage_worker(file, page, &page_start); 3557 + page_cache_release(page); 3558 + oncethru = 1; 3559 + goto start; 3560 } else { 3561 /* we could try using another file handle if there is one - 3562 but how would we lock it to prevent close of that handle