aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-08-05memblock: Introduce default allocation limit and use it to replace explicit onesBenjamin Herrenschmidt14-53/+63
This introduce memblock.current_limit which is used to limit allocations from memblock_alloc() or memblock_alloc_base(..., MEMBLOCK_ALLOC_ACCESSIBLE). The old MEMBLOCK_ALLOC_ANYWHERE changes value from 0 to ~(u64)0 and can still be used with memblock_alloc_base() to allocate really anywhere. It is -no-longer- cropped to MEMBLOCK_REAL_LIMIT which disappears. Note to archs: I'm leaving the default limit to MEMBLOCK_ALLOC_ANYWHERE. I strongly recommend that you ensure that you set an appropriate limit during boot in order to guarantee that an memblock_alloc() at any time results in something that is accessible with a simple __va(). The reason is that a subsequent patch will introduce the ability for the array to resize itself by reallocating itself. The MEMBLOCK core will honor the current limit when performing those allocations. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-05memblock: Expose MEMBLOCK_ALLOC_ANYWHEREBenjamin Herrenschmidt3-3/+2
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-05memblock: Factor the lowest level alloc functionBenjamin Herrenschmidt1-32/+27
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-05memblock: Remove nid_range argument, arch provides memblock_nid_range() insteadBenjamin Herrenschmidt3-17/+19
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-05memblock: Remove memblock_find()Benjamin Herrenschmidt2-33/+0
Nobody uses it anymore. It's semantics were ... weird Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-05memblock: Remove obsolete accessorsBenjamin Herrenschmidt1-23/+0
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-05memblock/arm: Use new accessorsBenjamin Herrenschmidt1-9/+12
CC: Russell King <linux@arm.linux.org.uk> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock/powerpc: Use new accessorsBenjamin Herrenschmidt3-71/+46
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock/sparc: Use new accessorsBenjamin Herrenschmidt1-18/+12
CC: David S. Miller <davem@davemloft.net> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock/sh: Use new accessorsBenjamin Herrenschmidt1-8/+9
CC: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock/microblaze: Use new accessorsBenjamin Herrenschmidt1-11/+9
CC: Michal Simek <monstr@monstr.eu> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock: Introduce for_each_memblock() and new accessorsBenjamin Herrenschmidt1-0/+52
Walk memblock's using for_each_memblock() and use memblock_region_base/end_pfn() for getting to PFNs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock/arm: Use memblock_region_is_memory() for omap fbBenjamin Herrenschmidt2-11/+3
Instead of the deprecated memblock_find() Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock/arm: pfn_valid uses memblock_is_memory()Benjamin Herrenschmidt1-14/+1
The implementation is pretty much similar. There is a -small- added overhead by having another function call and the address shift. If that becomes a concern, I suppose we could actually have memblock itself expose a memblock_pfn_valid() which then ARM can use directly with an appropriate #define... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock: Implement memblock_is_memory and memblock_is_region_memoryBenjamin Herrenschmidt2-8/+36
To make it fast, we steal ARM's binary search for memblock_is_memory() and we use that to also the replace existing implementation of memblock_is_reserved(). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock: No reason to include asm/memblock.h lateBenjamin Herrenschmidt1-2/+2
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock: Rename memblock_region to memblock_type and memblock_property to memblock_regionBenjamin Herrenschmidt10-120/+118
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-04memblock: Fix memblock_is_region_reserved() to return a booleanBenjamin Herrenschmidt1-1/+1
All callers expect a boolean result which is true if the region overlaps a reserved region. However, the implementation actually returns -1 if there is no overlap, and a region index (0 based) if there is. Make it behave as callers (and common sense) expect. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-08-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmwLinus Torvalds11-88/+169
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: GFS2: Fix recovery stuck bug (try #2) GFS2: Fix typo in stuffed file data copy handling Revert "GFS2: recovery stuck on transaction lock" GFS2: Make "try" lock not try quite so hard GFS2: remove dependency on __GFP_NOFAIL GFS2: Simplify gfs2_write_alloc_required GFS2: Wait for journal id on mount if not specified on mount command line GFS2: Use nobh_writepage
2010-08-03Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6Linus Torvalds6-74/+198
* 'linux-next' of git://git.infradead.org/ubi-2.6: UBI: do not warn unnecessarily UBI: do not print message about corruptes PEBs if we have none of them UBI: improve delete-compatible volumes handling UBI: fix error message and compilation warnings UBI: generate random image_seq when formatting MTD devices UBI: improve ECC error message UBI: improve corrupted flash handling UBI: introduce eraseblock counter variables UBI: introduce a new IO return code UBI: simplify IO error codes
2010-08-03Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6Linus Torvalds4-14/+29
* 'linux-next' of git://git.infradead.org/ubifs-2.6: UBIFS: fix a memory leak on error path. UBIFS: fix GC LEB recovery UBIFS: use ERR_CAST UBIFS: check return code
2010-08-03Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fsLinus Torvalds18-123/+1845
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: (22 commits) 9p: fix sparse warnings in new xattr code fs/9p: remove sparse warning in vfs_inode fs/9p: destroy fid on failed remove fs/9p: Prevent parallel rename when doing fid_lookup fs/9p: Add support user. xattr net/9p: Implement TXATTRCREATE 9p call net/9p: Implement attrwalk 9p call 9p: Implement LOPEN fs/9p: This patch implements TLCREATE for 9p2000.L protocol. 9p: Implement TMKDIR 9p: Implement TMKNOD 9p: Define and implement TSYMLINK for 9P2000.L 9p: Define and implement TLINK for 9P2000.L 9p: Define and implement TLINK for 9P2000.L 9p: Implement client side of setattr for 9P2000.L protocol. 9p: getattr client implementation for 9P2000.L protocol. fs/9p: Pass the correct user credentials during attach net/9p: Handle the server returned error properly 9p: readdir implementation for 9p2000.L 9p: Make use of iounit for read/write ...
2010-08-03Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfsLinus Torvalds91-4018/+1621
* 'for-linus' of git://oss.sgi.com/xfs/xfs: (49 commits) xfs simplify and speed up direct I/O completions xfs: move aio completion after unwritten extent conversion direct-io: move aio_complete into ->end_io xfs: fix big endian build xfs: clean up xfs_bmap_get_bp xfs: simplify xfs_truncate_file xfs: kill the b_strat callback in xfs_buf xfs: remove obsolete osyncisosync mount option xfs: clean up filestreams helpers xfs: fix gcc 4.6 set but not read and unused statement warnings xfs: Fix build when CONFIG_XFS_POSIX_ACL=n xfs: fix unsigned underflow in xfs_free_eofblocks xfs: use GFP_NOFS for page cache allocation xfs: fix memory reclaim recursion deadlock on locked inode buffer xfs: fix xfs_trans_add_item() lockdep warnings xfs: simplify and remove xfs_ireclaim xfs: don't block on buffer read errors xfs: move inode shrinker unregister even earlier xfs: remove a dmapi leftover xfs: writepage always has buffers ...
2010-08-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6Linus Torvalds21-116/+1006
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (29 commits) cifs: fsc should not default to "on" [CIFS] remove redundant path walking in dfs_do_refmount cifs: ignore the "mand", "nomand" and "_netdev" mount options cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS cifs: don't allow cifs_iget to match inodes of the wrong type [CIFS] relinquish fscache cookie before freeing CIFSTconInfo cifs: add separate cred_uid field to sesInfo fs: cifs: check kmalloc() result [CIFS] Missing ifdef [CIFS] Missing line from previous commit [CIFS] Fix build break when CONFIG_CIFS_FSCACHE disabled cifs: add mount option to enable local caching cifs: read pages from FS-Cache cifs: store pages into local cache cifs: FS-Cache page management cifs: define inode-level cache object and register them cifs: define superblock-level cache index objects and register them cifs: remove unused cifsUidInfo struct cifs: clean up cifs_find_smb_ses (try #2) cifs: match secType when searching for existing tcp session ...
2010-08-03Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds512-6552/+18499
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (291 commits) ARM: AMBA: Add pclk support to AMBA bus infrastructure ARM: 6278/2: fix regression in RealView after the introduction of pclk ARM: 6277/1: mach-shmobile: Allow users to select HZ, default to 128 ARM: 6276/1: mach-shmobile: remove duplicate NR_IRQS_LEGACY ARM: 6246/1: mmci: support larger MMCIDATALENGTH register ARM: 6245/1: mmci: enable hardware flow control on Ux500 variants ARM: 6244/1: mmci: add variant data and default MCICLOCK support ARM: 6243/1: mmci: pass power_mode to the translate_vdd callback ARM: 6274/1: add global control registers definition header file for nuc900 mx2_camera: fix type of dma buffer virtual address pointer mx2_camera: Add soc_camera support for i.MX25/i.MX27 arm/imx/gpio: add spinlock protection ARM: Add support for the LPC32XX arch ARM: LPC32XX: Arch config menu supoport and makefiles ARM: LPC32XX: Phytec 3250 platform support ARM: LPC32XX: Misc support functions ARM: LPC32XX: Serial support code ARM: LPC32XX: System suspend support ARM: LPC32XX: GPIO, timer, and IRQ drivers ARM: LPC32XX: Clock driver ...
2010-08-03PARISC: led.c - fix potential stack overflow in led_proc_write()Helge Deller1-2/+4
avoid potential stack overflow by correctly checking count parameter Reported-by: Ilja <ilja@netric.org> Signed-off-by: Helge Deller <deller@gmx.de> Acked-by: Kyle McMartin <kyle@mcmartin.ca> Cc: James E.J. Bottomley <jejb@parisc-linux.org> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-03UBIFS: fix a memory leak on error path.Matthieu CASTET1-1/+1
In 'mount_ubifs()', in case of 'ubifs_leb_unmap()' falure, free allocated resources. Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-08-029p: fix sparse warnings in new xattr codeEric Van Hensbergen1-2/+2
fixes: CHECK fs/9p/xattr.c fs/9p/xattr.c:73:6: warning: Using plain integer as NULL pointer fs/9p/xattr.c:135:6: warning: Using plain integer as NULL pointer Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02fs/9p: remove sparse warning in vfs_inodeEric Van Hensbergen1-1/+1
make v9fs_dentry_from_dir_inode static Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02fs/9p: destroy fid on failed removeAneesh Kumar K.V1-2/+1
9P spec says: "It is correct to consider remove to be a clunk with the side effect of removing the file if permissions allow. " So even if remove fails we need to destroy the fid. Without this patch an rmdir on a directory with contents leave the new cloned directory fid fid attached to fidlist. On umount we dump the fids on the fidlist ~# rmdir /mnt2/test4/ rmdir: failed to remove `/mnt2/test4/': Directory not empty ~# umount /mnt2/ ~# dmesg [ 228.474323] Found fid 3 not clunked Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02fs/9p: Prevent parallel rename when doing fid_lookupAneesh Kumar K.V5-39/+91
During fid lookup we need to make sure that the dentry->d_parent doesn't change so that we can safely walk the parent dentries. To ensure that we need to prevent cross directory rename during fid_lookup. Add a per superblock rename_sem rw_semaphore to prevent parallel fid lookup and rename. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02fs/9p: Add support user. xattrAneesh Kumar K.V6-3/+289
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02net/9p: Implement TXATTRCREATE 9p callAneesh Kumar K.V3-0/+28
TXATTRCREATE: Prepare a fid for setting xattr value on a file system object. size[4] TXATTRCREATE tag[2] fid[4] name[s] attr_size[8] flags[4] size[4] RXATTRCREATE tag[2] txattrcreate gets a fid pointing to xattr. This fid can later be used to set the xattr value. flag value is derived from set Linux setxattr. The manpage says "The flags parameter can be used to refine the semantics of the operation. XATTR_CREATE specifies a pure create, which fails if the named attribute exists already. XATTR_REPLACE specifies a pure replace operation, which fails if the named attribute does not already exist. By default (no flags), the extended attribute will be created if need be, or will simply replace the value if the attribute exists." The actual setxattr operation happens when the fid is clunked. At that point the written byte count and the attr_size specified in TXATTRCREATE should be same otherwise an error will be returned. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02net/9p: Implement attrwalk 9p callAneesh Kumar K.V3-0/+53
TXATTRWALK: Descend a ATTR namespace size[4] TXATTRWALK tag[2] fid[4] newfid[4] name[s] size[4] RXATTRWALK tag[2] size[8] txattrwalk gets a fid pointing to xattr. This fid can later be used to read the xattr value. If name is NULL the fid returned can be used to get the list of extended attribute associated to the file system object. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Implement LOPENM. Mohan Kumar3-11/+21
Implement 9p2000.L version of open(LOPEN) interface in 9p client. For LOPEN, no need to convert the flags to and from 9p mode to VFS mode. Synopsis: size[4] Tlopen tag[2] fid[4] mode[4] size[4] Rlopen tag[2] qid[13] iounit[4] [Fix mode bit format - jvrao@linux.vnet.ibm.com] Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbegren <ericvh@gmail.com>
2010-08-02fs/9p: This patch implements TLCREATE for 9p2000.L protocol.Venkateswararao Jujjuri (JV)4-1/+163
SYNOPSIS size[4] Tlcreate tag[2] fid[4] name[s] flags[4] mode[4] gid[4] size[4] Rlcreate tag[2] qid[13] iounit[4] DESCRIPTION The Tlreate request asks the file server to create a new regular file with the name supplied, in the directory (dir) represented by fid. The mode argument specifies the permissions to use. New file is created with the uid if the fid and with supplied gid. The flags argument represent Linux access mode flags with which the caller is requesting to open the file with. Protocol allows all the Linux access modes but it is upto the server to allow/disallow any of these acess modes. If the server doesn't support any of the access mode, it is expected to return error. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Implement TMKDIRM. Mohan Kumar4-3/+117
Implement TMKDIR as part of 2000.L Work Synopsis size[4] Tmkdir tag[2] fid[4] name[s] mode[4] gid[4] size[4] Rmkdir tag[2] qid[13] Description mkdir asks the file server to create a directory with given name, mode and gid. The qid for the new directory is returned with the mkdir reply message. Note: 72 is selected as the opcode for TMKDIR from the reserved list. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Implement TMKNODM. Mohan Kumar4-3/+140
Synopsis size[4] Tmknod tag[2] fid[4] name[s] mode[4] major[4] minor[4] gid[4] size[4] Rmknod tag[2] qid[13] Description mknod asks the file server to create a device node with given major and minor number, mode and gid. The qid for the new device node is returned with the mknod reply message. [sripathik@in.ibm.com: Fix error handling code] Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Define and implement TSYMLINK for 9P2000.LVenkateswararao Jujjuri (JV)4-4/+137
Create a symbolic link SYNOPSIS size[4] Tsymlink tag[2] fid[4] name[s] symtgt[s] gid[4] size[4] Rsymlink tag[2] qid[13] DESCRIPTION Create a symbolic link named 'name' pointing to 'symtgt'. gid represents the effective group id of the caller. The permissions of a symbolic link are irrelevant hence it is omitted from the protocol. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Reviewed-by: Sripathi Kodi <sripathik@in.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Define and implement TLINK for 9P2000.LVenkateswararao Jujjuri (JV)3-0/+22
This patch adds a helper function to get the dentry from inode and uses it in creating a Hardlink SYNOPSIS size[4] Tlink tag[2] dfid[4] oldfid[4] newpath[s] size[4] Rlink tag[2] DESCRIPTION Create a link 'newpath' in directory pointed by dfid linking to oldfid path. [sripathik@in.ibm.com : p9_client_link should not free req structure if p9_client_rpc has returned an error.] Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Define and implement TLINK for 9P2000.LEric Van Hensbergen1-1/+106
This patch adds a helper function to get the dentry from inode and uses it in creating a Hardlink SYNOPSIS size[4] Tlink tag[2] dfid[4] oldfid[4] newpath[s] size[4] Rlink tag[2] DESCRIPTION Create a link 'newpath' in directory pointed by dfid linking to oldfid path. [sripathik@in.ibm.com : p9_client_link should not free req structure if p9_client_rpc has returned an error.] Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Implement client side of setattr for 9P2000.L protocol.Sripathi Kodi5-3/+122
SYNOPSIS size[4] Tsetattr tag[2] attr[n] size[4] Rsetattr tag[2] DESCRIPTION The setattr command changes some of the file status information. attr resembles the iattr structure used in Linux kernel. It specifies which status parameter is to be changed and to what value. It is laid out as follows: valid[4] specifies which status information is to be changed. Possible values are: ATTR_MODE (1 << 0) ATTR_UID (1 << 1) ATTR_GID (1 << 2) ATTR_SIZE (1 << 3) ATTR_ATIME (1 << 4) ATTR_MTIME (1 << 5) ATTR_ATIME_SET (1 << 7) ATTR_MTIME_SET (1 << 8) The last two bits represent whether the time information is being sent by the client's user space. In the absense of these bits the server always uses server's time. mode[4] File permission bits uid[4] Owner id of file gid[4] Group id of the file size[8] File size atime_sec[8] Time of last file access, seconds atime_nsec[8] Time of last file access, nanoseconds mtime_sec[8] Time of last file modification, seconds mtime_nsec[8] Time of last file modification, nanoseconds Explanation of the patches: -------------------------- *) The kernel just copies relevent contents of iattr structure to p9_iattr_dotl structure and passes it down to the client. The only check it has is calling inode_change_ok() *) The p9_iattr_dotl structure does not have ctime and ia_file parameters because I don't think these are needed in our case. The client user space can request updating just ctime by calling chown(fd, -1, -1). This is handled on server side without a need for putting ctime on the wire. *) The server currently supports changing mode, time, ownership and size of the file. *) 9P RFC says "Either all the changes in wstat request happen, or none of them does: if the request succeeds, all changes were made; if it fails, none were." I have not done anything to implement this specifically because I don't see a reason. Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: getattr client implementation for 9P2000.L protocol.Sripathi Kodi7-34/+321
SYNOPSIS size[4] Tgetattr tag[2] fid[4] request_mask[8] size[4] Rgetattr tag[2] lstat[n] DESCRIPTION The getattr transaction inquires about the file identified by fid. request_mask is a bit mask that specifies which fields of the stat structure is the client interested in. The reply will contain a machine-independent directory entry, laid out as follows: st_result_mask[8] Bit mask that indicates which fields in the stat structure have been populated by the server qid.type[1] the type of the file (directory, etc.), represented as a bit vector corresponding to the high 8 bits of the file's mode word. qid.vers[4] version number for given path qid.path[8] the file server's unique identification for the file st_mode[4] Permission and flags st_uid[4] User id of owner st_gid[4] Group ID of owner st_nlink[8] Number of hard links st_rdev[8] Device ID (if special file) st_size[8] Size, in bytes st_blksize[8] Block size for file system IO st_blocks[8] Number of file system blocks allocated st_atime_sec[8] Time of last access, seconds st_atime_nsec[8] Time of last access, nanoseconds st_mtime_sec[8] Time of last modification, seconds st_mtime_nsec[8] Time of last modification, nanoseconds st_ctime_sec[8] Time of last status change, seconds st_ctime_nsec[8] Time of last status change, nanoseconds st_btime_sec[8] Time of creation (birth) of file, seconds st_btime_nsec[8] Time of creation (birth) of file, nanoseconds st_gen[8] Inode generation st_data_version[8] Data version number request_mask and result_mask bit masks contain the following bits #define P9_STATS_MODE 0x00000001ULL #define P9_STATS_NLINK 0x00000002ULL #define P9_STATS_UID 0x00000004ULL #define P9_STATS_GID 0x00000008ULL #define P9_STATS_RDEV 0x00000010ULL #define P9_STATS_ATIME 0x00000020ULL #define P9_STATS_MTIME 0x00000040ULL #define P9_STATS_CTIME 0x00000080ULL #define P9_STATS_INO 0x00000100ULL #define P9_STATS_SIZE 0x00000200ULL #define P9_STATS_BLOCKS 0x00000400ULL #define P9_STATS_BTIME 0x00000800ULL #define P9_STATS_GEN 0x00001000ULL #define P9_STATS_DATA_VERSION 0x00002000ULL #define P9_STATS_BASIC 0x000007ffULL #define P9_STATS_ALL 0x00003fffULL This patch implements the client side of getattr implementation for 9P2000.L. It introduces a new structure p9_stat_dotl for getting Linux stat information along with QID. The data layout is similar to stat structure in Linux user space with the following major differences: inode (st_ino) is not part of data. Instead qid is. device (st_dev) is not part of data because this doesn't make sense on the client. All time variables are 64 bit wide on the wire. The kernel seems to use 32 bit variables for these variables. However, some of the architectures have used 64 bit variables and glibc exposes 64 bit variables to user space on some architectures. Hence to be on the safer side we have made these 64 bit in the protocol. Refer to the comments in include/asm-generic/stat.h There are some additional fields: st_btime_sec, st_btime_nsec, st_gen, st_data_version apart from the bitmask, st_result_mask. The bit mask is filled by the server to indicate which stat fields have been populated by the server. Currently there is no clean way for the server to obtain these additional fields, so it sends back just the basic fields. Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Signed-off-by: Eric Van Hensbegren <ericvh@gmail.com>
2010-08-02fs/9p: Pass the correct user credentials during attachAneesh Kumar K.V2-2/+3
We need to make sure we pass the right uid value during attach. dotl is similar to dotu in this regard. Without this mapped security model on dotl doesn't work Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02net/9p: Handle the server returned error properlyAneesh Kumar K.V1-1/+2
We need to get the negative errno value in the kernel even for dotl. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: readdir implementation for 9p2000.LSripathi Kodi5-16/+227
This patch implements the kernel part of readdir() implementation for 9p2000.L Change from V3: Instead of inode, server now sends qids for each dirent SYNOPSIS size[4] Treaddir tag[2] fid[4] offset[8] count[4] size[4] Rreaddir tag[2] count[4] data[count] DESCRIPTION The readdir request asks the server to read the directory specified by 'fid' at an offset specified by 'offset' and return as many dirent structures as possible that fit into count bytes. Each dirent structure is laid out as follows. qid.type[1] the type of the file (directory, etc.), represented as a bit vector corresponding to the high 8 bits of the file's mode word. qid.vers[4] version number for given path qid.path[8] the file server's unique identification for the file offset[8] offset into the next dirent. type[1] type of this directory entry. name[256] name of this directory entry. This patch adds v9fs_dir_readdir_dotl() as the readdir() call for 9p2000.L. This function sends P9_TREADDIR command to the server. In response the server sends a buffer filled with dirent structures. This is different from the existing v9fs_dir_readdir() call which receives stat structures from the server. This results in significant speedup of readdir() on large directories. For example, doing 'ls >/dev/null' on a directory with 10000 files on my laptop takes 1.088 seconds with the existing code, but only takes 0.339 seconds with the new readdir. Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: Make use of iounit for read/writeM. Mohan Kumar1-6/+7
Change the v9fs_file_readn function to limit the maximum transfer size based on the iounit or msize. Also remove the redundant check for limiting the transfer size in v9fs_file_write. This check is done by p9_client_write. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-029p: strlen() doesn't count the terminatorDan Carpenter1-1/+1
This is an off by one bug because strlen() doesn't count the NULL terminator. We strcpy() addr into a fixed length array of size UNIX_PATH_MAX later on. The addr variable is the name of the device being mounted. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02virtio_9p.h needs <linux/types.h>Fang Wenqi1-0/+1
Found with makes headers_check: include/linux/virtio_9p.h:15: found __[us]{8,16,32,64} type without #include <linux/types.h> Signed-off-by: Fang Wenqi <antonf@turbolinux.com.cn> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2010-08-02Merge branch 'v2.6.35'Alex Elder188-633/+1399