Whamcloud - gitweb
LU-808 llite: deny truncate beyond user rlimit
[fs/lustre-release.git] / lustre / liblustre / llite_lib.h
index efc130b..780a3c3 100644 (file)
@@ -28,6 +28,8 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -65,7 +67,7 @@
 
 /* This should not be "optimized" use ~0ULL because page->index is a long and
  * 32-bit systems are therefore limited to 16TB in a mapping */
-#define PAGE_CACHE_MAXBYTES ((__u64)(~0UL) << CFS_PAGE_SHIFT)
+#define MAX_LFS_FILESIZE ((__u64)(~0UL) << CFS_PAGE_SHIFT)
 struct ll_file_data {
         struct obd_client_handle fd_mds_och;
         __u32 fd_flags;
@@ -101,7 +103,6 @@ struct llu_inode_info {
 
         struct lov_stripe_md   *lli_smd;
         char                   *lli_symlink_name;
-        cfs_semaphore_t         lli_open_sem;
         __u64                   lli_maxbytes;
         unsigned long           lli_flags;
         __u64                   lli_ioepoch;
@@ -261,7 +262,6 @@ extern struct fssw_ops llu_fssw_ops;
 void llu_prep_md_op_data(struct md_op_data *op_data, struct inode *i1,
                          struct inode *i2, const char *name, int namelen,
                          int mode, __u32 opc);
-void llu_finish_md_op_data(struct md_op_data *op_data);
 int llu_create(struct inode *dir, struct pnode_base *pnode, int mode);
 int llu_local_open(struct llu_inode_info *lli, struct lookup_intent *it);
 int llu_iop_open(struct pnode *pnode, int flags, mode_t mode);
@@ -370,8 +370,6 @@ void put_io_group(struct llu_io_group *group);
 
 int cl_sb_init(struct llu_sb_info *sbi);
 int cl_sb_fini(struct llu_sb_info *sbi);
-int cl_inode_init(struct inode *inode, struct lustre_md *md);
-void cl_inode_fini(struct inode *inode);
 
 void llu_io_init(struct cl_io *io, struct inode *inode, int write);
 
@@ -405,6 +403,12 @@ static inline struct slp_io *slp_env_io(const struct lu_env *env)
 #define cl_isize_write(inode,kms)        do{llu_i2stat(inode)->st_size = kms;}while(0)
 #define cl_isize_write_nolock(inode,kms) cl_isize_write(inode,kms)
 
+static inline struct ll_file_data *cl_iattr2fd(struct inode *inode,
+                                               const struct iattr *attr)
+{
+        return llu_i2info(inode)->lli_file_data;
+}
+
 static inline void cl_isize_lock(struct inode *inode, int lsmlock)
 {
 }
@@ -428,4 +432,18 @@ static inline struct obd_capa *cl_capa_lookup(struct inode *inode,
         return NULL;
 }
 
+static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt,
+                                  int rc)
+{
+}
+
+static inline loff_t i_size_read(struct inode *inode)
+{
+        return inode->i_stbuf.st_size;
+}
+
+static inline void i_size_write(struct inode *inode, loff_t i_sz)
+{
+        inode->i_stbuf.st_size = i_sz;
+}
 #endif