Whamcloud - gitweb
LU-1346 libcfs: replace cfs_ memory wrappers
[fs/lustre-release.git] / lustre / llite / rw.c
index 5b32414..b6eb577 100644 (file)
@@ -154,10 +154,11 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
                  */
                 io->ci_lockreq = CILR_NEVER;
 
-                pos = (vmpage->index << CFS_PAGE_SHIFT);
+               pos = (vmpage->index << PAGE_CACHE_SHIFT);
 
-                /* Create a temp IO to serve write. */
-                result = cl_io_rw_init(env, io, CIT_WRITE, pos, CFS_PAGE_SIZE);
+               /* Create a temp IO to serve write. */
+               result = cl_io_rw_init(env, io, CIT_WRITE,
+                                      pos, PAGE_CACHE_SIZE);
                 if (result == 0) {
                         cio->cui_fd = LUSTRE_FPRIVATE(file);
                         cio->cui_iov = NULL;
@@ -567,12 +568,12 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io,
  * sense to tune the i_blkbits value for the file based on the OSTs it is
  * striped over, rather than having a constant value for all files here. */
 
-/* RAS_INCREASE_STEP should be (1UL << (inode->i_blkbits - CFS_PAGE_SHIFT)).
+/* RAS_INCREASE_STEP should be (1UL << (inode->i_blkbits - PAGE_CACHE_SHIFT)).
  * Temprarily set RAS_INCREASE_STEP to 1MB. After 4MB RPC is enabled
  * by default, this should be adjusted corresponding with max_read_ahead_mb
  * and max_read_ahead_per_file_mb otherwise the readahead budget can be used
  * up quickly which will affect read performance siginificantly. See LU-2816 */
-#define RAS_INCREASE_STEP(inode) (ONE_MB_BRW_SIZE >> CFS_PAGE_SHIFT)
+#define RAS_INCREASE_STEP(inode) (ONE_MB_BRW_SIZE >> PAGE_CACHE_SHIFT)
 
 static inline int stride_io_mode(struct ll_readahead_state *ras)
 {
@@ -780,7 +781,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
                         end = rpc_boundary;
 
                 /* Truncate RA window to end of file */
-                end = min(end, (unsigned long)((kms - 1) >> CFS_PAGE_SHIFT));
+               end = min(end, (unsigned long)((kms - 1) >> PAGE_CACHE_SHIFT));
 
                 ras->ras_next_readahead = max(end, end + 1);
                 RAS_CDEBUG(ras);
@@ -818,7 +819,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
         if (reserved != 0)
                 ll_ra_count_put(ll_i2sbi(inode), reserved);
 
-        if (ra_end == end + 1 && ra_end == (kms >> CFS_PAGE_SHIFT))
+       if (ra_end == end + 1 && ra_end == (kms >> PAGE_CACHE_SHIFT))
                 ll_ra_stats_inc(mapping, RA_STAT_EOF);
 
         /* if we didn't get to the end of the region we reserved from
@@ -1030,8 +1031,8 @@ void ras_update(struct ll_sb_info *sbi, struct inode *inode,
         if (ras->ras_requests == 2 && !ras->ras_request_index) {
                 __u64 kms_pages;
 
-                kms_pages = (i_size_read(inode) + CFS_PAGE_SIZE - 1) >>
-                            CFS_PAGE_SHIFT;
+               kms_pages = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >>
+                           PAGE_CACHE_SHIFT;
 
                 CDEBUG(D_READA, "kmsp "LPU64" mwp %lu mp %lu\n", kms_pages,
                        ra->ra_max_read_ahead_whole_pages, ra->ra_max_pages_per_file);
@@ -1212,7 +1213,7 @@ int ll_writepage(struct page *vmpage, struct writeback_control *wbc)
                 * breaking kernel which assumes ->writepage should mark
                 * PageWriteback or clean the page. */
                result = cl_sync_file_range(inode, offset,
-                                           offset + CFS_PAGE_SIZE - 1,
+                                           offset + PAGE_CACHE_SIZE - 1,
                                            CL_FSYNC_LOCAL, 1);
                if (result > 0) {
                        /* actually we may have written more than one page.
@@ -1250,7 +1251,7 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc)
        ENTRY;
 
        if (wbc->range_cyclic) {
-               start = mapping->writeback_index << CFS_PAGE_SHIFT;
+               start = mapping->writeback_index << PAGE_CACHE_SHIFT;
                end = OBD_OBJECT_EOF;
        } else {
                start = wbc->range_start;
@@ -1279,7 +1280,7 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc)
        if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) {
                if (end == OBD_OBJECT_EOF)
                        end = i_size_read(inode);
-               mapping->writeback_index = (end >> CFS_PAGE_SHIFT) + 1;
+               mapping->writeback_index = (end >> PAGE_CACHE_SHIFT) + 1;
        }
        RETURN(result);
 }