Whamcloud - gitweb
LU-2675 obd: remove dead code
[fs/lustre-release.git] / lustre / obdclass / linux / linux-obdo.c
index 5af2ff6..97192ff 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#else
-#include <linux/module.h>
-#include <obd_class.h>
-#include <lustre/lustre_idl.h>
-#endif
-
-#ifdef __KERNEL__
 #include <linux/fs.h>
+#include <linux/module.h>
 #include <linux/pagemap.h> /* for PAGE_CACHE_SIZE */
+#include <lustre/lustre_idl.h>
+#include <obd_class.h>
 
 /*FIXME: Just copy from obdo_from_inode*/
-void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid)
+void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid)
 {
         obd_flag newvalid = 0;
 
@@ -158,7 +152,8 @@ void la_from_obdo(struct lu_attr *dst, const struct obdo *obdo, obd_flag valid)
 }
 EXPORT_SYMBOL(la_from_obdo);
 
-void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid)
+void obdo_refresh_inode(struct inode *dst, const struct obdo *src,
+                       obd_flag valid)
 {
         valid &= src->o_valid;
 
@@ -192,44 +187,3 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid)
                 dst->i_blocks = src->o_blocks;
 }
 EXPORT_SYMBOL(obdo_refresh_inode);
-
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
-{
-        valid &= src->o_valid;
-
-       LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
-                           OBD_MD_FLID | OBD_MD_FLGROUP)),
-                "object "DOSTID", valid %x\n", POSTID(&src->o_oi), valid);
-
-        if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
-                CDEBUG(D_INODE,
-                       "valid "LPX64", cur time %lu/%lu, new "LPU64"/"LPU64"\n",
-                       src->o_valid, LTIME_S(dst->i_mtime),
-                       LTIME_S(dst->i_ctime), src->o_mtime, src->o_ctime);
-
-       if (valid & OBD_MD_FLATIME)
-               LTIME_S(dst->i_atime) = src->o_atime;
-       if (valid & OBD_MD_FLMTIME)
-               LTIME_S(dst->i_mtime) = src->o_mtime;
-       if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(dst->i_ctime))
-               LTIME_S(dst->i_ctime) = src->o_ctime;
-       if (valid & OBD_MD_FLSIZE)
-               i_size_write(dst, src->o_size);
-       if (valid & OBD_MD_FLBLOCKS) { /* allocation of space */
-               dst->i_blocks = src->o_blocks;
-               if (dst->i_blocks < src->o_blocks) /* overflow */
-                       dst->i_blocks = -1;
-       }
-       if (valid & OBD_MD_FLBLKSZ)
-               dst->i_blkbits = ffs(src->o_blksize)-1;
-       if (valid & OBD_MD_FLMODE)
-               dst->i_mode = (dst->i_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
-       if (valid & OBD_MD_FLUID)
-               dst->i_uid = make_kuid(&init_user_ns, src->o_uid);
-       if (valid & OBD_MD_FLGID)
-               dst->i_gid = make_kgid(&init_user_ns, src->o_gid);
-       if (valid & OBD_MD_FLFLAGS)
-               dst->i_flags = src->o_flags;
-}
-EXPORT_SYMBOL(obdo_to_inode);
-#endif