lkml.org 
[lkml]   [2006]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 10/22][RFC] Unionfs: Inode operations

    >+ //DQ: vfs_create has a different prototype in 2.6

    I found a relic! :-)

    >+ if (IS_ERR(hidden_dentry)) {
    >+ err = PTR_ERR(hidden_dentry);
    >+ }
    -{}

    >+/* We don't lock the dentry here, because readlink does the heavy lifting. */
    >+static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
    >+{
    >+ char *buf;
    >+ int len = PAGE_SIZE, err;
    >+ mm_segment_t old_fs;
    >+
    >+ /* This is freed by the put_link method assuming a successful call. */
    >+ buf = (char *)kmalloc(len, GFP_KERNEL);

    Nocast.

    >+void unionfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
    >+{
    >+ char *link;
    >+ link = nd_get_link(nd);
    >+ kfree(link);
    >+}

    kfree(nd_get_link(nd));

    >+ /* Ordinary permission routines do not understand MAY_APPEND. */
    >+ submask = mask & ~MAY_APPEND;
    >+ if (inode->i_op && inode->i_op->permission) {
    >+ retval = inode->i_op->permission(inode, submask, nd);
    >+ if ((retval == -EACCES) && (submask & MAY_WRITE) &&
    >+ (!strcmp("nfs", (inode)->i_sb->s_type->name)) &&
    >+ (nd) && (nd->mnt) && (nd->mnt->mnt_sb) &&
    >+ (branchperms(nd->mnt->mnt_sb, bindex) & MAY_NFSRO)) {
    >+ retval = generic_permission(inode, submask, NULL);

    I am not sure right now, I would need to test; does someone know out of the box
    whether other network filesystems (in particular SMBFS/CIFS) behave like NFS
    and also return -EACCES rather than -EROFS?

    >+ return ((retval == -EROFS) ? 0 : retval); /* ignore EROFS */
    outer ()
    >+ for (bindex = bstart; (bindex <= bend) || (bindex == bstart); bindex++) {

    >+ /* if error is in the leftmost f/s, pass it up */

    "f/s" => branch, to follow unionfs terminiology.



    Jan Engelhardt
    --

    --
    VGER BF report: H 0.0311395
    -
    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: 2006-09-04 09:25    [W:0.023 / U:33.012 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site