aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/super.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-17 21:51:42 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-17 21:51:42 -0500
commitc58310bf4933986513020fa90b4190c7492995ae (patch)
tree143f2c7578d02ebef5db8fc57ae69e951ae0e2ee /fs/ecryptfs/super.c
parent269cdfaf769f5cd831284cc831790c7c5038040f (diff)
parent1309d4e68497184d2fd87e892ddf14076c2bda98 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/ecryptfs/super.c')
-rw-r--r--fs/ecryptfs/super.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/fs/ecryptfs/super.c b/fs/ecryptfs/super.c
index 4859c4eecd65..c27ac2b358a1 100644
--- a/fs/ecryptfs/super.c
+++ b/fs/ecryptfs/super.c
@@ -156,32 +156,38 @@ static void ecryptfs_clear_inode(struct inode *inode)
156/** 156/**
157 * ecryptfs_show_options 157 * ecryptfs_show_options
158 * 158 *
159 * Prints the directory we are currently mounted over. 159 * Prints the mount options for a given superblock.
160 * Returns zero on success; non-zero otherwise 160 * Returns zero; does not fail.
161 */ 161 */
162static int ecryptfs_show_options(struct seq_file *m, struct vfsmount *mnt) 162static int ecryptfs_show_options(struct seq_file *m, struct vfsmount *mnt)
163{ 163{
164 struct super_block *sb = mnt->mnt_sb; 164 struct super_block *sb = mnt->mnt_sb;
165 struct dentry *lower_root_dentry = ecryptfs_dentry_to_lower(sb->s_root); 165 struct ecryptfs_mount_crypt_stat *mount_crypt_stat =
166 struct vfsmount *lower_mnt = ecryptfs_dentry_to_lower_mnt(sb->s_root); 166 &ecryptfs_superblock_to_private(sb)->mount_crypt_stat;
167 char *tmp_page; 167 struct ecryptfs_global_auth_tok *walker;
168 char *path; 168
169 int rc = 0; 169 mutex_lock(&mount_crypt_stat->global_auth_tok_list_mutex);
170 170 list_for_each_entry(walker,
171 tmp_page = (char *)__get_free_page(GFP_KERNEL); 171 &mount_crypt_stat->global_auth_tok_list,
172 if (!tmp_page) { 172 mount_crypt_stat_list) {
173 rc = -ENOMEM; 173 seq_printf(m, ",ecryptfs_sig=%s", walker->sig);
174 goto out;
175 }
176 path = d_path(lower_root_dentry, lower_mnt, tmp_page, PAGE_SIZE);
177 if (IS_ERR(path)) {
178 rc = PTR_ERR(path);
179 goto out;
180 } 174 }
181 seq_printf(m, ",dir=%s", path); 175 mutex_unlock(&mount_crypt_stat->global_auth_tok_list_mutex);
182 free_page((unsigned long)tmp_page); 176
183out: 177 seq_printf(m, ",ecryptfs_cipher=%s",
184 return rc; 178 mount_crypt_stat->global_default_cipher_name);
179
180 if (mount_crypt_stat->global_default_cipher_key_size)
181 seq_printf(m, ",ecryptfs_key_bytes=%zd",
182 mount_crypt_stat->global_default_cipher_key_size);
183 if (mount_crypt_stat->flags & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)
184 seq_printf(m, ",ecryptfs_passthrough");
185 if (mount_crypt_stat->flags & ECRYPTFS_XATTR_METADATA_ENABLED)
186 seq_printf(m, ",ecryptfs_xattr_metadata");
187 if (mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED)
188 seq_printf(m, ",ecryptfs_encrypted_view");
189
190 return 0;
185} 191}
186 192
187const struct super_operations ecryptfs_sops = { 193const struct super_operations ecryptfs_sops = {