13 Sep, 2010

5 commits


30 Aug, 2010

1 commit


11 Aug, 2010

2 commits

  • Signed-off-by: Stephen Rothwell
    Signed-off-by: Al Viro

    Stephen Rothwell
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
    no need for list_for_each_entry_safe()/resetting with superblock list
    Fix sget() race with failing mount
    vfs: don't hold s_umount over close_bdev_exclusive() call
    sysv: do not mark superblock dirty on remount
    sysv: do not mark superblock dirty on mount
    btrfs: remove junk sb_dirt change
    BFS: clean up the superblock usage
    AFFS: wait for sb synchronization when needed
    AFFS: clean up dirty flag usage
    cifs: truncate fallout
    mbcache: fix shrinker function return value
    mbcache: Remove unused features
    add f_flags to struct statfs(64)
    pass a struct path to vfs_statfs
    update VFS documentation for method changes.
    All filesystems that need invalidate_inode_buffers() are doing that explicitly
    convert remaining ->clear_inode() to ->evict_inode()
    Make ->drop_inode() just return whether inode needs to be dropped
    fs/inode.c:clear_inode() is gone
    fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
    ...

    Fix up trivial conflicts in fs/nilfs2/super.c

    Linus Torvalds
     

10 Aug, 2010

2 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • Replace inode_setattr with opencoded variants of it in all callers. This
    moves the remaining call to vmtruncate into the filesystem methods where it
    can be replaced with the proper truncate sequence.

    In a few cases it was obvious that we would never end up calling vmtruncate
    so it was left out in the opencoded variant:

    spufs: explicitly checks for ATTR_SIZE earlier
    btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
    ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above

    In addition to that ncpfs called inode_setattr with handcrafted iattrs,
    which allowed to trim down the opencoded variant.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

03 Aug, 2010

15 commits

  • 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

    Eric Van Hensbergen
     
  • make v9fs_dentry_from_dir_inode static

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • 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
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • 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
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbegren

    M. Mohan Kumar
     
  • 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
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • 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
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    M. Mohan Kumar
     
  • 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
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    M. Mohan Kumar
     
  • 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
    Reviewed-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • 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
    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • 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
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • 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
    Signed-off-by: Eric Van Hensbegren

    Sripathi Kodi
     
  • 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
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • 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
    Reviewed-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • 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
    Signed-off-by: Eric Van Hensbergen

    M. Mohan Kumar
     

28 Jul, 2010

1 commit


28 May, 2010

1 commit


24 May, 2010

1 commit


23 May, 2010

4 commits

  • This patch removes a redundant fid clone on the directory fid and hence
    reduces a server transaction while creating new filesystem object.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri
     
  • We never use "v9ses" and so we can remove it.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Eric Van Hensbergen

    Dan Carpenter
     
  • Without this patch, an attempt to mksock will get an EINVAL.

    Before this patch:
    [root@localhost 1dir]# mksock mysock
    mksock: error making mysock: Invalid argument

    With this patch:
    [root@localhost 1dir]# mksock mysock
    [root@localhost 1dir]# ls -l mysock
    s--------- 1 root root 0 2010-03-31 17:44 mysock

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri
     
  • For lookup if we get ENOENT error from the server we still
    instantiate the dentry. We need to make sure we have dentry
    operations set in that case so that a later dput on the dentry
    does the expected. Without the patch we get the below error

    #ln -sf abc abclink
    ln: creating symbolic link `abclink': No such file or directory

    Now on the host do
    $ touch abclink

    Guest now gives ENOENT error.
    # ls
    ls: cannot access abclink: No such file or directory

    Debugged-by:Gautham R Shenoy
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

22 May, 2010

4 commits

  • Signed-off-by: Dmitry Monakhov
    Signed-off-by: Al Viro

    Dmitry Monakhov
     
  • I made a V2 of this patch on top of my patches for VFS switches.
    All the changes were due to change in some offsets.

    rename - change name of file or directory

    size[4] Trename tag[2] fid[4] newdirfid[4] name[s]
    size[4] Rrename tag[2]

    The rename message is used to change the name of a file, possibly moving it
    to a new directory. The 9P wstat message can only rename a file within the
    same directory.

    Signed-off-by: Jim Garlick
    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • I made a V2 of this patch on top of my patches for VFS switches. The
    change was adding v9fs_statfs pointer to v9fs_super_ops_dotl
    instead of v9fs_super_ops.

    statfs - get file system statistics

    size[4] Tstatfs tag[2] fid[4]
    size[4] Rstatfs tag[2] type[4] bsize[4] blocks[8] bfree[8] bavail[8]
    files[8] ffree[8] fsid[8] namelen[4]

    The statfs message is used to request file system information returned
    by the statfs(2) system call, which is used by df(1) to report file
    system and disk space usage.

    Signed-off-by: Jim Garlick
    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • Implements VFS switches for 9p2000.L protocol.

    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     

22 Apr, 2010

1 commit


06 Apr, 2010

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    9p: saving negative to unsigned char
    9p: return on mutex_lock_interruptible()
    9p: Creating files with names too long should fail with ENAMETOOLONG.
    9p: Make sure we are able to clunk the cached fid on umount
    9p: drop nlink remove
    fs/9p: Clunk the fid resulting from partial walk of the name
    9p: documentation update
    9p: Fix setting of protocol flags in v9fs_session_info structure.

    Linus Torvalds
     
  • If "err" is -EINTR here the original code calls mutex_unlock() and then
    returns, but it should just return directly.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Eric Van Hensbergen

    ------------------------------------------------------------------------------
    Download Intel® Parallel Studio Eval
    Try the new software tools for yourself. Speed compiling, find bugs
    proactively, and fine-tune applications for parallel performance.
    See why Intel Parallel Studio got high marks during beta.
    http://p.sf.net/sfu/intel-sw-dev

    Dan Carpenter
     

05 Apr, 2010

1 commit