Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8250
b: refs/heads/master
c: d8a5ba4
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Sep 9, 2005
1 parent caa42bc commit a03ac7b
Show file tree
Hide file tree
Showing 5 changed files with 563 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04578f174f43d29b569500f01ba772afa4016330
refs/heads/master: d8a5ba45457e4a22aa39c939121efd7bb6c76672
7 changes: 7 additions & 0 deletions trunk/fs/fuse/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Makefile for the FUSE filesystem.
#

obj-$(CONFIG_FUSE_FS) += fuse.o

fuse-objs := inode.o
89 changes: 89 additions & 0 deletions trunk/fs/fuse/fuse_i.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/

#include <linux/fuse.h>
#include <linux/fs.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/backing-dev.h>
#include <asm/semaphore.h>

/** FUSE inode */
struct fuse_inode {
/** Inode data */
struct inode inode;

/** Unique ID, which identifies the inode between userspace
* and kernel */
u64 nodeid;

/** Time in jiffies until the file attributes are valid */
unsigned long i_time;
};

/**
* A Fuse connection.
*
* This structure is created, when the filesystem is mounted, and is
* destroyed, when the client device is closed and the filesystem is
* unmounted.
*/
struct fuse_conn {
/** The superblock of the mounted filesystem */
struct super_block *sb;

/** The user id for this mount */
uid_t user_id;

/** Backing dev info */
struct backing_dev_info bdi;
};

static inline struct fuse_conn **get_fuse_conn_super_p(struct super_block *sb)
{
return (struct fuse_conn **) &sb->s_fs_info;
}

static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
{
return *get_fuse_conn_super_p(sb);
}

static inline struct fuse_conn *get_fuse_conn(struct inode *inode)
{
return get_fuse_conn_super(inode->i_sb);
}

static inline struct fuse_inode *get_fuse_inode(struct inode *inode)
{
return container_of(inode, struct fuse_inode, inode);
}

static inline u64 get_node_id(struct inode *inode)
{
return get_fuse_inode(inode)->nodeid;
}

/**
* This is the single global spinlock which protects FUSE's structures
*
* The following data is protected by this lock:
*
* - the s_fs_info field of the super block
* - the sb (super_block) field in fuse_conn
*/
extern spinlock_t fuse_lock;

/**
* Check if the connection can be released, and if yes, then free the
* connection structure
*/
void fuse_release_conn(struct fuse_conn *fc);

Loading

0 comments on commit a03ac7b

Please sign in to comment.