From 9c302674d8e7f65219b6c4e6d5c0a27d44f2c458 Mon Sep 17 00:00:00 2001
From: yangsheng <yangsheng>
Date: Thu, 7 Aug 2008 14:59:24 +0000
Subject: [PATCH] Branch HEAD b=16208 i=adilger, johann

Implement .show_option method for lustre.
---
 lustre/llite/llite_internal.h |  1 +
 lustre/llite/llite_lib.c      | 25 +++++++++++++++++++++++++
 lustre/llite/super25.c        |  1 +
 3 files changed, 27 insertions(+)

diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
index 6f3e7d1b70..9f5e7b587a 100644
--- a/lustre/llite/llite_internal.h
+++ b/lustre/llite/llite_internal.h
@@ -867,6 +867,7 @@ void ll_umount_begin(struct vfsmount *vfsmnt, int flags);
 void ll_umount_begin(struct super_block *sb);
 #endif
 int ll_remount_fs(struct super_block *sb, int *flags, char *data);
+int ll_show_options(struct seq_file *seq, struct vfsmount *vfs);
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
                   struct super_block *);
 void lustre_dump_dentry(struct dentry *, int recur);
diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
index 78f9a33a15..2fc698ccc5 100644
--- a/lustre/llite/llite_lib.c
+++ b/lustre/llite/llite_lib.c
@@ -2403,3 +2403,28 @@ void ll_finish_md_op_data(struct md_op_data *op_data)
         capa_put(op_data->op_capa2);
         OBD_FREE_PTR(op_data);
 }
+
+int ll_show_options(struct seq_file *seq, struct vfsmount *vfs)
+{
+        struct ll_sb_info *sbi;
+
+        LASSERT((seq != NULL) && (vfs != NULL));
+        sbi = ll_s2sbi(vfs->mnt_sb);
+
+        if (sbi->ll_flags & LL_SBI_NOLCK)
+                seq_puts(seq, ",nolock");
+
+        if (sbi->ll_flags & LL_SBI_FLOCK)
+                seq_puts(seq, ",flock");
+
+        if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
+                seq_puts(seq, ",localflock");
+
+        if (sbi->ll_flags & LL_SBI_USER_XATTR)
+                seq_puts(seq, ",user_xattr");
+
+        if (sbi->ll_flags & LL_SBI_ACL)
+                seq_puts(seq, ",acl");
+
+        RETURN(0);
+}
diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c
index 549d32017b..979f0c493c 100644
--- a/lustre/llite/super25.c
+++ b/lustre/llite/super25.c
@@ -99,6 +99,7 @@ struct super_operations lustre_super_operations =
         .statfs        = ll_statfs,
         .umount_begin  = ll_umount_begin,
         .remount_fs    = ll_remount_fs,
+        .show_options  = ll_show_options,
 };
 
 
-- 
GitLab