lkml.org 
[lkml]   [2007]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/16] Unionfs: call statfs on lower file system properly
    Date
    From: Erez Zadok <ezk@cs.sunysb.edu>

    Get the correct lower dentry to use to statfs the first branch (always),

    Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
    Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
    ---
    fs/unionfs/super.c | 15 ++++++++++-----
    1 files changed, 10 insertions(+), 5 deletions(-)

    diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
    index b3a5e64..a7ff06c 100644
    --- a/fs/unionfs/super.c
    +++ b/fs/unionfs/super.c
    @@ -112,18 +112,23 @@ static void unionfs_put_super(struct super_block *sb)
    static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
    {
    int err = 0;
    - struct super_block *sb, *hidden_sb;
    + struct super_block *sb;
    + struct dentry *lower_dentry;

    BUG_ON(!is_valid_dentry(dentry));

    sb = dentry->d_sb;

    - unionfs_read_lock(sb);
    - hidden_sb = unionfs_lower_super_idx(sb, sbstart(sb));
    - unionfs_read_unlock(sb);
    - err = vfs_statfs(hidden_sb->s_root, buf);
    + lower_dentry = unionfs_lower_dentry(sb->s_root);
    + err = vfs_statfs(lower_dentry, buf);

    + /* set return buf to our f/s to avoid confusing user-level utils */
    buf->f_type = UNIONFS_SUPER_MAGIC;
    +
    + /*
    + * Our maximum file name can is shorter by a few bytes because every
    + * file name could potentially be whited-out.
    + */
    buf->f_namelen -= UNIONFS_WHLEN;

    memset(&buf->f_fsid, 0, sizeof(__kernel_fsid_t));
    --
    1.5.2.rc1.165.gaf9b
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-06-17 21:17    [W:0.019 / U:1.716 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site