aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/westbridge
diff options
context:
space:
mode:
authorDavid Cross <david.cross@cypress.com>2010-09-10 19:55:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-14 19:52:47 -0400
commit4c404487aa3d26bf7a7e16f8545778385e06d839 (patch)
treee492a3f8884e5377cf663a2631ce339cb055c305 /drivers/staging/westbridge
parent72bbd9bce41276d06b6b816df21aced71b1896eb (diff)
staging: west bridge: cyasgadget, remove file system / vfs calls
This patch remove file system specific (fat_get_block) and vfs calls from the cyasgadget driver. The current implementation expects user space to write the file (open, seek to end, 1 byte write), followed by a call to clear the dirty pages from the the page cache. Signed-off-by: David Cross <david.cross@cypress.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/westbridge')
-rw-r--r--drivers/staging/westbridge/astoria/gadget/cyasgadget.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/drivers/staging/westbridge/astoria/gadget/cyasgadget.c b/drivers/staging/westbridge/astoria/gadget/cyasgadget.c
index 48080b39abe..756ff278f66 100644
--- a/drivers/staging/westbridge/astoria/gadget/cyasgadget.c
+++ b/drivers/staging/westbridge/astoria/gadget/cyasgadget.c
@@ -1149,11 +1149,9 @@ static int cyasgadget_ioctl(
1149 struct inode *inode = mapping->host; 1149 struct inode *inode = mapping->host;
1150 struct inode *alloc_inode = 1150 struct inode *alloc_inode =
1151 file_to_allocate->f_path.dentry->d_inode; 1151 file_to_allocate->f_path.dentry->d_inode;
1152 int cluster = 0;
1153 uint32_t num_clusters = 0; 1152 uint32_t num_clusters = 0;
1154 struct buffer_head bh; 1153 struct buffer_head bh;
1155 struct kstat stat; 1154 struct kstat stat;
1156 struct iattr alloc_iattr;
1157 int nr_pages = 0; 1155 int nr_pages = 0;
1158 int ret_stat = 0; 1156 int ret_stat = 0;
1159 1157
@@ -1188,47 +1186,7 @@ static int cyasgadget_ioctl(
1188 /* block size is arbitrary , we'll use sector size*/ 1186 /* block size is arbitrary , we'll use sector size*/
1189 bh.b_size = SECTOR_SIZE ; 1187 bh.b_size = SECTOR_SIZE ;
1190 1188
1191 #ifndef WESTBRIDGE_NDEBUG
1192 cy_as_hal_print_message("%s: getting fat blocks %d "
1193 "size of %d\n", __func__,
1194 num_clusters, bh.b_size);
1195 #endif
1196 for (cluster = 0; cluster < num_clusters; cluster++) {
1197 ret_stat = fat_get_block(inode,
1198 cluster, &bh, 1);
1199 if (ret_stat) {
1200 cy_as_hal_print_message(
1201 "%s: unable to get fat block, "
1202 "ret_stat=0x%d\n",
1203 __func__, ret_stat);
1204 goto initsoj_safe_exit;
1205 }
1206 }
1207 1189
1208 #ifndef WESTBRIDGE_NDEBUG
1209 cy_as_hal_print_message("%s: allocated clusters "
1210 "successfully (fat_get_block), check bmap..."
1211 "\n", __func__);
1212 #endif
1213
1214 alloc_iattr.ia_valid = ATTR_SIZE;
1215 alloc_iattr.ia_size = k_d.num_bytes;
1216
1217 #ifndef WESTBRIDGE_NDEBUG
1218 cy_as_hal_print_message("%s: calling fat_notify_change "
1219 "(ia_valid:%d, ia_size:%d)\n", __func__,
1220 alloc_iattr.ia_valid,
1221 (int)alloc_iattr.ia_size);
1222 #endif
1223
1224 /* adjust the filesize */
1225 ret_stat = alloc_inode->i_op->setattr(
1226 file_to_allocate->f_path.dentry, &alloc_iattr);
1227 #ifndef WESTBRIDGE_NDEBUG
1228 cy_as_hal_print_message("%s: fat_setattr() "
1229 "returned 0x%x\n",
1230 __func__, ret_stat);
1231 #endif
1232 1190
1233 /* clear dirty pages in page cache 1191 /* clear dirty pages in page cache
1234 * (if were any allocated) */ 1192 * (if were any allocated) */