[PATCH] kAFS automount support

From: David Howells (dhowells_at_redhat.com)
Date: 06/30/04

  • Next message: Adrian Bunk: "Re: kernel compile error on SuSE 9.1"
    To: torvalds@osdl.org, akpm@osdl.org
    Date:	Wed, 30 Jun 2004 20:41:52 +0100
    
    

    Hi Linus, Andrew,

    Here's a patch to allow the kAFS filesystem to use the automount facility
    patch presented in a previous email.

    It allows me to mount an AFS root volume on /afs and then just walk through
    the directory structure causing referenced volumes to be automounted and
    autoumounted.

    For instance, if I do:

            [root@andromeda root]# mount -t afs \#root.afs. /afs
            [root@andromeda root]# ls /afs
            asd cambridge cambridge.redhat.com grand.central.org
            [root@andromeda root]# ls /afs/cambridge
            afsdoc
            [root@andromeda root]# ls /afs/cambridge/afsdoc/
            ChangeLog html LICENSE pdf RELNOTES-1.2.2

    And then look in the mountpoint catalogue, I see:

            [root@andromeda root]# cat /proc/mounts
            ...
            #root.afs. /afs afs rw 0 0
            #root.cell. /afs/cambridge.redhat.com afs rw 0 0
            #afsdoc. /afs/cambridge.redhat.com/afsdoc afs rw 0 0

    Then after waiting a few minutes:

            [root@andromeda root]# cat /proc/mounts
            ...
            #root.afs. /afs afs rw 0 0

    Is all that remains.

    David

    diff -uNr linux-2.6.7/fs/afs/cmservice.c linux-2.6.7-auto/fs/afs/cmservice.c
    --- linux-2.6.7/fs/afs/cmservice.c 2004-06-18 13:41:16.000000000 +0100
    +++ linux-2.6.7-auto/fs/afs/cmservice.c 2004-06-30 20:04:06.392069575 +0100
    @@ -307,10 +307,8 @@
                     if (ret < 0)
                             goto kill;
     
    -#ifdef AFS_AUTOMOUNT_SUPPORT
                     afs_kafstimod_add_timer(&afs_mntpt_expiry_timer,
                                             afs_mntpt_expiry_timeout * HZ);
    -#endif
             }
     
             afscm_usage++;
    @@ -392,9 +390,7 @@
                     }
                     spin_unlock(&kafscmd_attention_lock);
     
    -#ifdef AFS_AUTOMOUNT_SUPPORT
                     afs_kafstimod_del_timer(&afs_mntpt_expiry_timer);
    -#endif
             }
     
             up_write(&afscm_sem);
    diff -uNr linux-2.6.7/fs/afs/internal.h linux-2.6.7-auto/fs/afs/internal.h
    --- linux-2.6.7/fs/afs/internal.h 2004-06-18 13:41:17.000000000 +0100
    +++ linux-2.6.7-auto/fs/afs/internal.h 2004-06-30 20:04:06.390069741 +0100
    @@ -107,11 +107,9 @@
      */
     extern struct inode_operations afs_mntpt_inode_operations;
     extern struct file_operations afs_mntpt_file_operations;
    -#ifdef AFS_AUTOMOUNT_SUPPORT
     extern struct afs_timer afs_mntpt_expiry_timer;
     extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
     extern unsigned long afs_mntpt_expiry_timeout;
    -#endif
     
     extern int afs_mntpt_check_symlink(struct afs_vnode *vnode);
     
    diff -uNr linux-2.6.7/fs/afs/mntpt.c linux-2.6.7-auto/fs/afs/mntpt.c
    --- linux-2.6.7/fs/afs/mntpt.c 2004-06-18 13:41:16.000000000 +0100
    +++ linux-2.6.7-auto/fs/afs/mntpt.c 2004-06-30 20:04:04.180253426 +0100
    @@ -30,10 +30,7 @@
                                            struct dentry *dentry,
                                            struct nameidata *nd);
     static int afs_mntpt_open(struct inode *inode, struct file *file);
    -
    -#ifdef AFS_AUTOMOUNT_SUPPORT
     static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd);
    -#endif
     
     struct file_operations afs_mntpt_file_operations = {
             .open = afs_mntpt_open,
    @@ -41,14 +38,11 @@
     
     struct inode_operations afs_mntpt_inode_operations = {
             .lookup = afs_mntpt_lookup,
    -#ifdef AFS_AUTOMOUNT_SUPPORT
             .follow_link = afs_mntpt_follow_link,
    -#endif
             .readlink = page_readlink,
             .getattr = afs_inode_getattr,
     };
     
    -#ifdef AFS_AUTOMOUNT_SUPPORT
     static LIST_HEAD(afs_vfsmounts);
     
     static void afs_mntpt_expiry_timed_out(struct afs_timer *timer);
    @@ -60,7 +54,6 @@
     struct afs_timer afs_mntpt_expiry_timer;
     
     unsigned long afs_mntpt_expiry_timeout = 20;
    -#endif
     
     /*****************************************************************************/
     /*
    @@ -156,7 +149,6 @@
             return -EREMOTE;
     } /* end afs_mntpt_open() */
     
    -#ifdef AFS_AUTOMOUNT_SUPPORT
     /*****************************************************************************/
     /*
      * create a vfsmount to be automounted
    @@ -288,4 +280,3 @@
     
             kleave("");
     } /* end afs_mntpt_expiry_timed_out() */
    -#endif
    diff -uNr linux-2.6.7/fs/afs/super.c linux-2.6.7-auto/fs/afs/super.c
    --- linux-2.6.7/fs/afs/super.c 2004-06-18 13:41:16.000000000 +0100
    +++ linux-2.6.7-auto/fs/afs/super.c 2004-06-30 20:04:06.394069408 +0100
    @@ -78,9 +78,7 @@
     
             _enter("");
     
    -#ifdef AFS_AUTOMOUNT_SUPPORT
             afs_timer_init(&afs_mntpt_expiry_timer, &afs_mntpt_expiry_timer_ops);
    -#endif
     
             /* create ourselves an inode cache */
             atomic_set(&afs_count_active_inodes, 0);
    -
    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/


  • Next message: Adrian Bunk: "Re: kernel compile error on SuSE 9.1"

    Relevant Pages

    • [PATCH] kAFS automount support
      ... Here's a patch to allow the kAFS filesystem to use the automount facility ... It allows me to mount an AFS root volume on /afs and then just walk through ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: The argument for fs assistance in handling archives
      ... |>| thats why we have automount. ... I haven't had the need to mount and iso for quite some time, ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5
      ... >>this should result in latency being lower regardless of the ... > service (automount). ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] make automounter runnable in foreground and add stderr logging
      ... > And that would be the point of using configure to find this path info. ... I copied automount binary to another box, which has mount in /bin while old ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: The argument for fs assistance in handling archives
      ... | thats why we have automount. ... I have no fstab entry here and still I ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)