Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 21:15:12 +0000 (14:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Oct 2010 21:15:12 +0000 (14:15 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6:
  eCryptfs: Print mount_auth_tok_only param in ecryptfs_show_options
  ecryptfs: added ecryptfs_mount_auth_tok_only mount parameter
  ecryptfs: checking return code of ecryptfs_find_auth_tok_for_sig()
  ecryptfs: release keys loaded in ecryptfs_keyring_auth_tok_for_sig()
  eCryptfs: Clear LOOKUP_OPEN flag when creating lower file
  ecryptfs: call vfs_setxattr() in ecryptfs_setxattr()

1  2 
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/main.c

@@@ -377,6 -377,7 +377,7 @@@ struct ecryptfs_mount_crypt_stat 
  #define ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES      0x00000010
  #define ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK   0x00000020
  #define ECRYPTFS_GLOBAL_ENCFN_USE_FEK          0x00000040
+ #define ECRYPTFS_GLOBAL_MOUNT_AUTH_TOK_ONLY    0x00000080
        u32 flags;
        struct list_head global_auth_tok_list;
        struct mutex global_auth_tok_list_mutex;
@@@ -477,7 -478,7 +478,7 @@@ ecryptfs_lower_header_size(struct ecryp
  static inline struct ecryptfs_file_info *
  ecryptfs_file_to_private(struct file *file)
  {
 -      return (struct ecryptfs_file_info *)file->private_data;
 +      return file->private_data;
  }
  
  static inline void
diff --combined fs/ecryptfs/main.c
@@@ -208,7 -208,8 +208,8 @@@ enum { ecryptfs_opt_sig, ecryptfs_opt_e
         ecryptfs_opt_passthrough, ecryptfs_opt_xattr_metadata,
         ecryptfs_opt_encrypted_view, ecryptfs_opt_fnek_sig,
         ecryptfs_opt_fn_cipher, ecryptfs_opt_fn_cipher_key_bytes,
-        ecryptfs_opt_unlink_sigs, ecryptfs_opt_err };
+        ecryptfs_opt_unlink_sigs, ecryptfs_opt_mount_auth_tok_only,
+        ecryptfs_opt_err };
  
  static const match_table_t tokens = {
        {ecryptfs_opt_sig, "sig=%s"},
        {ecryptfs_opt_fn_cipher, "ecryptfs_fn_cipher=%s"},
        {ecryptfs_opt_fn_cipher_key_bytes, "ecryptfs_fn_key_bytes=%u"},
        {ecryptfs_opt_unlink_sigs, "ecryptfs_unlink_sigs"},
+       {ecryptfs_opt_mount_auth_tok_only, "ecryptfs_mount_auth_tok_only"},
        {ecryptfs_opt_err, NULL}
  };
  
@@@ -406,6 -408,10 +408,10 @@@ static int ecryptfs_parse_options(struc
                case ecryptfs_opt_unlink_sigs:
                        mount_crypt_stat->flags |= ECRYPTFS_UNLINK_SIGS;
                        break;
+               case ecryptfs_opt_mount_auth_tok_only:
+                       mount_crypt_stat->flags |=
+                               ECRYPTFS_GLOBAL_MOUNT_AUTH_TOK_ONLY;
+                       break;
                case ecryptfs_opt_err:
                default:
                        printk(KERN_WARNING
@@@ -540,8 -546,9 +546,8 @@@ out
   *                        ecryptfs_interpose to perform most of the linking
   * ecryptfs_interpose(): links the lower filesystem into ecryptfs (inode.c)
   */
 -static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
 -                      const char *dev_name, void *raw_data,
 -                      struct vfsmount *mnt)
 +static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags,
 +                      const char *dev_name, void *raw_data)
  {
        struct super_block *s;
        struct ecryptfs_sb_info *sbi;
                err = "Reading sb failed";
                goto out;
        }
 -      simple_set_mnt(mnt, s);
 -      return 0;
 +      return dget(s->s_root);
  
  out:
        if (sbi) {
                kmem_cache_free(ecryptfs_sb_info_cache, sbi);
        }
        printk(KERN_ERR "%s; rc = [%d]\n", err, rc);
 -      return rc;
 +      return ERR_PTR(rc);
  }
  
  /**
@@@ -637,7 -645,7 +643,7 @@@ static void ecryptfs_kill_block_super(s
  static struct file_system_type ecryptfs_fs_type = {
        .owner = THIS_MODULE,
        .name = "ecryptfs",
 -      .get_sb = ecryptfs_get_sb,
 +      .mount = ecryptfs_mount,
        .kill_sb = ecryptfs_kill_block_super,
        .fs_flags = 0
  };