~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to fs/9p/vfs_super.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        } else
87
87
                sb->s_op = &v9fs_super_ops;
88
88
        sb->s_bdi = &v9ses->bdi;
 
89
        if (v9ses->cache)
 
90
                sb->s_bdi->ra_pages = (VM_MAX_READAHEAD * 1024)/PAGE_CACHE_SIZE;
89
91
 
90
 
        sb->s_flags = flags | MS_ACTIVE | MS_SYNCHRONOUS | MS_DIRSYNC |
91
 
            MS_NOATIME;
 
92
        sb->s_flags = flags | MS_ACTIVE | MS_DIRSYNC | MS_NOATIME;
 
93
        if (!v9ses->cache)
 
94
                sb->s_flags |= MS_SYNCHRONOUS;
92
95
 
93
96
#ifdef CONFIG_9P_FS_POSIX_ACL
94
 
        if ((v9ses->flags & V9FS_ACCESS_MASK) == V9FS_ACCESS_CLIENT)
 
97
        if ((v9ses->flags & V9FS_ACL_MASK) == V9FS_POSIX_ACL)
95
98
                sb->s_flags |= MS_POSIXACL;
96
99
#endif
97
100
 
166
169
                        retval = PTR_ERR(st);
167
170
                        goto release_sb;
168
171
                }
169
 
 
 
172
                root->d_inode->i_ino = v9fs_qid2ino(&st->qid);
170
173
                v9fs_stat2inode_dotl(st, root->d_inode);
171
174
                kfree(st);
172
175
        } else {
253
256
                goto done;
254
257
        }
255
258
 
256
 
        v9ses = v9fs_inode2v9ses(dentry->d_inode);
 
259
        v9ses = v9fs_dentry2v9ses(dentry);
257
260
        if (v9fs_proto_dotl(v9ses)) {
258
261
                res = p9_client_statfs(fid, &rs);
259
262
                if (res == 0) {
276
279
        return res;
277
280
}
278
281
 
 
282
static int v9fs_drop_inode(struct inode *inode)
 
283
{
 
284
        struct v9fs_session_info *v9ses;
 
285
        v9ses = v9fs_inode2v9ses(inode);
 
286
        if (v9ses->cache)
 
287
                return generic_drop_inode(inode);
 
288
        /*
 
289
         * in case of non cached mode always drop the
 
290
         * the inode because we want the inode attribute
 
291
         * to always match that on the server.
 
292
         */
 
293
        return 1;
 
294
}
 
295
 
 
296
static int v9fs_write_inode(struct inode *inode,
 
297
                            struct writeback_control *wbc)
 
298
{
 
299
        int ret;
 
300
        struct p9_wstat wstat;
 
301
        struct v9fs_inode *v9inode;
 
302
        /*
 
303
         * send an fsync request to server irrespective of
 
304
         * wbc->sync_mode.
 
305
         */
 
306
        P9_DPRINTK(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
 
307
        v9inode = V9FS_I(inode);
 
308
        if (!v9inode->writeback_fid)
 
309
                return 0;
 
310
        v9fs_blank_wstat(&wstat);
 
311
 
 
312
        ret = p9_client_wstat(v9inode->writeback_fid, &wstat);
 
313
        if (ret < 0) {
 
314
                __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
 
315
                return ret;
 
316
        }
 
317
        return 0;
 
318
}
 
319
 
 
320
static int v9fs_write_inode_dotl(struct inode *inode,
 
321
                                 struct writeback_control *wbc)
 
322
{
 
323
        int ret;
 
324
        struct v9fs_inode *v9inode;
 
325
        /*
 
326
         * send an fsync request to server irrespective of
 
327
         * wbc->sync_mode.
 
328
         */
 
329
        P9_DPRINTK(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
 
330
        v9inode = V9FS_I(inode);
 
331
        if (!v9inode->writeback_fid)
 
332
                return 0;
 
333
        ret = p9_client_fsync(v9inode->writeback_fid, 0);
 
334
        if (ret < 0) {
 
335
                __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
 
336
                return ret;
 
337
        }
 
338
        return 0;
 
339
}
 
340
 
279
341
static const struct super_operations v9fs_super_ops = {
280
 
#ifdef CONFIG_9P_FSCACHE
281
342
        .alloc_inode = v9fs_alloc_inode,
282
343
        .destroy_inode = v9fs_destroy_inode,
283
 
#endif
284
344
        .statfs = simple_statfs,
285
345
        .evict_inode = v9fs_evict_inode,
286
346
        .show_options = generic_show_options,
287
347
        .umount_begin = v9fs_umount_begin,
 
348
        .write_inode = v9fs_write_inode,
288
349
};
289
350
 
290
351
static const struct super_operations v9fs_super_ops_dotl = {
291
 
#ifdef CONFIG_9P_FSCACHE
292
352
        .alloc_inode = v9fs_alloc_inode,
293
353
        .destroy_inode = v9fs_destroy_inode,
294
 
#endif
295
354
        .statfs = v9fs_statfs,
 
355
        .drop_inode = v9fs_drop_inode,
296
356
        .evict_inode = v9fs_evict_inode,
297
357
        .show_options = generic_show_options,
298
358
        .umount_begin = v9fs_umount_begin,
 
359
        .write_inode = v9fs_write_inode_dotl,
299
360
};
300
361
 
301
362
struct file_system_type v9fs_fs_type = {
303
364
        .mount = v9fs_mount,
304
365
        .kill_sb = v9fs_kill_super,
305
366
        .owner = THIS_MODULE,
306
 
        .fs_flags = FS_RENAME_DOES_D_MOVE,
 
367
        .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT,
307
368
};