Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Sat, 5 Aug 2006 03:29:29 +0000 (03:29 +0000)
committerwangdi <wangdi>
Sat, 5 Aug 2006 03:29:29 +0000 (03:29 +0000)
1)add RMF_ACL as nikita's comments
2)some cleanup

lustre/include/linux/lustre_acl.h
lustre/include/lustre_mds.h
lustre/include/lustre_req_layout.h
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_request.c
lustre/mdd/mdd_lov.c
lustre/mds/handler.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_open.c
lustre/ptlrpc/layout.c

index 8d26910..ed0be5c 100644 (file)
 # include <linux/xattr_acl.h>
 # endif
 #endif
-#include <linux/lustre_handles.h>
-#include <libcfs/kp30.h>
-#include <linux/lustre_idl.h>
-#include <linux/lustre_lib.h>
-#include <linux/lustre_dlm.h>
-#include <linux/lustre_log.h>
-#include <linux/lustre_export.h>
 
+/* ACL */
 #ifdef CONFIG_FS_POSIX_ACL
 #define LUSTRE_POSIX_ACL_MAX_ENTRIES    (32)
 #define LUSTRE_POSIX_ACL_MAX_SIZE       \
-                (xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES))
+        (sizeof(xattr_acl_header) + 32 * sizeof(xattr_acl_entry))
 #else
 #define LUSTRE_POSIX_ACL_MAX_SIZE       0
 #endif
 
+
 #endif
index 901829f..00ba485 100644 (file)
@@ -68,14 +68,6 @@ struct mds_file_data {
         struct dentry        *mfd_dentry;
 };
 
-/* ACL */
-#ifdef CONFIG_FS_POSIX_ACL
-#define LUSTRE_POSIX_ACL_MAX_ENTRIES    (32)
-#define LUSTRE_POSIX_ACL_MAX_SIZE       \
-                (xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES))
-#else
-#define LUSTRE_POSIX_ACL_MAX_SIZE       0
-#endif
 
 /* mds/mds_reint.c */
 struct inode;
index 3822717..4ddc09e 100644 (file)
@@ -141,6 +141,7 @@ extern const struct req_msg_field RMF_REC_UNLINK;
 extern const struct req_msg_field RMF_REC_RENAME;
 extern const struct req_msg_field RMF_REC_SETATTR;
 extern const struct req_msg_field RMF_EADATA;
+extern const struct req_msg_field RMF_ACL;
 extern const struct req_msg_field RMF_LOGCOOKIES;
 extern const struct req_msg_field RMF_REINT_OPC;
 
index edb4e20..44fdcff 100644 (file)
 # include <linux/pagemap.h>
 # include <linux/miscdevice.h>
 # include <linux/init.h>
+#include <linux/lustre_acl.h>
 #else
 # include <liblustre.h>
 #endif
 
 #include <obd_class.h>
 #include <lustre_dlm.h>
-#include <lustre_mds.h>
 #include <lprocfs_status.h>
 #include "mdc_internal.h"
 
@@ -417,7 +417,6 @@ int mdc_enqueue(struct obd_export *exp,
                 RETURN(-EINVAL);
         }
 
-        /* get ready for the reply */
         req->rq_replen = lustre_msg_size(repbufcnt, repsize);
 
         mdc_get_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
index 67a5534..9b02718 100644 (file)
@@ -31,6 +31,7 @@
 # include <linux/module.h>
 # include <linux/pagemap.h>
 # include <linux/miscdevice.h>
+# include <linux/lustre_acl.h>
 # include <linux/init.h>
 #else
 # include <liblustre.h>
@@ -39,7 +40,6 @@
 #include <obd_class.h>
 #include <lustre_dlm.h>
 #include <lustre_fid.h>
-#include <lustre_mds.h> /* for LUSTRE_POSIX_ACL_MAX_SIZE */
 #include <md_object.h>
 #include <lprocfs_status.h>
 #include "mdc_internal.h"
index f301d0e..493d028 100644 (file)
@@ -333,7 +333,7 @@ int mdd_lov_set_md(const struct lu_context *ctxt, struct md_object *pobj,
  * lsm object unique in the whole mds, as I see. But it seems, we
  * still not need it now. right? so just borrow the ll_fid_build_ino
  */
-static obd_id mdd_lov_create_id(struct lu_fid *fid)
+static obd_id mdd_lov_create_id(const struct lu_fid *fid)
 {
         return ((fid_seq(fid) - 1) * LUSTRE_SEQ_MAX_WIDTH + fid_oid(fid));
 }
index fdc3108..181d7c4 100644 (file)
@@ -50,6 +50,7 @@
 # include <linux/locks.h>
 #endif
 
+#include <linux/lustre_acl.h>
 #include <obd_class.h>
 #include <lustre_dlm.h>
 #include <obd_lov.h>
index 7de9e22..2d78fce 100644 (file)
@@ -55,7 +55,7 @@
 #include <dt_object.h>
 #include <lustre_mds.h>
 #include "mdt_internal.h"
-
+#include <linux/lustre_acl.h>
 /*
  * Initialized in mdt_mod_init().
  */
@@ -281,8 +281,8 @@ static int mdt_getattr_internal(struct mdt_thread_info *info,
 #ifdef CONFIG_FS_POSIX_ACL
         if ((req->rq_export->exp_connect_flags & OBD_CONNECT_ACL) &&
             (reqbody->valid & OBD_MD_FLACL)) {
-                buffer = req_capsule_server_get(pill, &RMF_EADATA);
-                length = req_capsule_get_size(pill, &RMF_EADATA, RCL_SERVER);
+                buffer = req_capsule_server_get(pill, &RMF_ACL);
+                length = req_capsule_get_size(pill, &RMF_ACL, RCL_SERVER);
                 if (length > 0) {
                         rc = mo_xattr_get(ctxt, next, buffer,
                                           length, XATTR_NAME_ACL_ACCESS);
@@ -324,8 +324,8 @@ static int mdt_getattr(struct mdt_thread_info *info)
         ENTRY;
 
 
-        req_capsule_set_size(&info->mti_pill, &RMF_EADATA,
-                             RCL_SERVER, LUSTRE_POSIX_ACL_MAX_SIZE);
+        req_capsule_set_size(&info->mti_pill, &RMF_MDT_MD,
+                             RCL_SERVER, info->mti_mdt->mdt_max_mdsize);
 
         result = req_capsule_pack(&info->mti_pill);
         if (result)
@@ -456,8 +456,6 @@ static int mdt_getattr_name(struct mdt_thread_info *info)
 
         req_capsule_set_size(&info->mti_pill, &RMF_MDT_MD,
                              RCL_SERVER, info->mti_mdt->mdt_max_mdsize);
-        req_capsule_set_size(&info->mti_pill, &RMF_EADATA,
-                             RCL_SERVER, LUSTRE_POSIX_ACL_MAX_SIZE);
 
         rc = req_capsule_pack(&info->mti_pill);
         if (rc)
@@ -1534,9 +1532,6 @@ static int mdt_intent_getattr(enum mdt_it_code opcode,
         req_capsule_set_size(&info->mti_pill, &RMF_MDT_MD,
                              RCL_SERVER, mdt->mdt_max_mdsize);
 
-        req_capsule_set_size(&info->mti_pill, &RMF_EADATA,
-                             RCL_SERVER, LUSTRE_POSIX_ACL_MAX_SIZE);
-
         rc = req_capsule_pack(&info->mti_pill);
         if (rc)
                 RETURN(rc);
index 9769c27..779e104 100644 (file)
@@ -31,6 +31,7 @@
 #endif
 #define DEBUG_SUBSYSTEM S_MDS
 
+#include <linux/lustre_acl.h>
 #include <lustre_mds.h>
 #include "mdt_internal.h"
 
@@ -155,7 +156,8 @@ static int mdt_mfd_open(struct mdt_thread_info *info,
                         repbody->valid |= OBD_MD_FLEASIZE;
         }
 
-        /*FIXME: should determine the offset dynamicly */
+        /*FIXME: should determine the offset dynamicly, 
+         *did not get ACL before shrink*/
         lustre_shrink_reply(req, 2, repbody->eadatasize, 1);
         lustre_shrink_reply(req, repbody->eadatasize ? 3 : 2, repbody->aclsize, 0);
 
@@ -270,9 +272,6 @@ int mdt_reint_open(struct mdt_thread_info *info)
         req_capsule_set_size(&info->mti_pill, &RMF_MDT_MD, RCL_SERVER,
                              mdt->mdt_max_mdsize);
 
-        req_capsule_set_size(&info->mti_pill, &RMF_EADATA, RCL_SERVER,
-                             LUSTRE_POSIX_ACL_MAX_SIZE);
-
         result = req_capsule_pack(&info->mti_pill);
         if (result)
                 RETURN(result);
index 40dee66..04eec61 100644 (file)
@@ -52,6 +52,7 @@
 #endif
 /* struct ptlrpc_request, lustre_msg* */
 #include <lustre_req_layout.h>
+#include <linux/lustre_acl.h>
 
 static const struct req_msg_field *empty[] = {}; /* none */
 
@@ -104,6 +105,7 @@ static const struct req_msg_field *mds_reint_open_client[] = {
 static const struct req_msg_field *mds_reint_open_server[] = {
         &RMF_MDT_BODY,
         &RMF_MDT_MD,
+        &RMF_ACL
 };
 
 static const struct req_msg_field *mds_reint_unlink_client[] = {
@@ -163,7 +165,7 @@ static const struct req_msg_field *ldlm_intent_server[] = {
         &RMF_DLM_REP,
         &RMF_MDT_BODY,
         &RMF_MDT_MD,
-        &RMF_EADATA
+        &RMF_ACL
 };
 
 static const struct req_msg_field *ldlm_intent_getattr_client[] = {
@@ -215,7 +217,7 @@ static const struct req_msg_field *mds_setxattr_client[] = {
 static const struct req_msg_field *mds_getattr_server[] = {
         &RMF_MDT_BODY,
         &RMF_MDT_MD,
-        &RMF_EADATA
+        &RMF_ACL
 };
 
 static const struct req_format *req_formats[] = {
@@ -389,6 +391,10 @@ EXPORT_SYMBOL(RMF_REC_SETATTR);
 const struct req_msg_field RMF_EADATA = DEFINE_MSGF("eadata", 0, -1, NULL);
 EXPORT_SYMBOL(RMF_EADATA);
 
+const struct req_msg_field RMF_ACL = DEFINE_MSGF("acl", 0, 
+                                     LUSTRE_POSIX_ACL_MAX_SIZE, NULL);
+EXPORT_SYMBOL(RMF_ACL);
+
 const struct req_msg_field RMF_LOGCOOKIES =
         DEFINE_MSGF("logcookies", 0, sizeof(struct llog_cookie), NULL);
 EXPORT_SYMBOL(RMF_LOGCOOKIES);