summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/llite/llite_internal.h
diff options
context:
space:
mode:
authorJohn L. Hammond <john.hammond@intel.com>2016-10-02 22:28:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-16 10:24:35 +0200
commit090a648530c13adc7e27ed2bb0a6d48b66635c1f (patch)
tree00199c0d709388c2893e76120c37745e869b1f24 /drivers/staging/lustre/lustre/llite/llite_internal.h
parent85cb63bc68a7b18fcc2966346b0ed774812973d9 (diff)
downloadop-kernel-dev-090a648530c13adc7e27ed2bb0a6d48b66635c1f.zip
op-kernel-dev-090a648530c13adc7e27ed2bb0a6d48b66635c1f.tar.gz
staging: lustre: llite: add cl_object_maxbytes()
Add cl_object_maxbytes() to return the maximum supported size of a cl_object. Remove the lli_maxbytes member from struct ll_inode_info. Change the lsm_maxbytes member of struct lov_stripe_md from __u64 to loff_t. Correct the computation of lsm_maxbytes in the released layout case. Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814 Reviewed-on: http://review.whamcloud.com/13694 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/llite_internal.h')
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_internal.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index c972eac..675a41a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -185,7 +185,6 @@ struct ll_inode_info {
struct {
struct mutex lli_size_mutex;
char *lli_symlink_name;
- __u64 lli_maxbytes;
/*
* struct rw_semaphore {
* signed long count; // align d.d_def_acl
@@ -977,9 +976,14 @@ static inline struct lu_fid *ll_inode2fid(struct inode *inode)
return fid;
}
-static inline __u64 ll_file_maxbytes(struct inode *inode)
+static inline loff_t ll_file_maxbytes(struct inode *inode)
{
- return ll_i2info(inode)->lli_maxbytes;
+ struct cl_object *obj = ll_i2info(inode)->lli_clob;
+
+ if (!obj)
+ return MAX_LFS_FILESIZE;
+
+ return min_t(loff_t, cl_object_maxbytes(obj), MAX_LFS_FILESIZE);
}
/* llite/xattr.c */
OpenPOWER on IntegriCloud